Skip to content

Commit

Permalink
Added test cases showing bug when dealing with number variables
Browse files Browse the repository at this point in the history
  • Loading branch information
imbcmdth committed Feb 18, 2012
1 parent 1300945 commit fe422d3
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/tags/set.test.js
Expand Up @@ -39,6 +39,8 @@ exports.set = testCase({
'set number is really a number [gh-53]': function (test) {
test.strictEqual(swig.compile('{% set foo = 1 %}{{ foo|add(1) }}')(), '2', 'literal number is a number');
test.strictEqual(swig.compile('{% set foo = "1" %}{{ foo|add(1) }}')(), '11', 'string number is not a number');
test.strictEqual(swig.compile('{% set bar = 1 %}{% set foo = bar %}{{ foo|add(1) }}')(), '2', 'number variable remains a number after set');
test.strictEqual(swig.compile('{% set foo = 1 %}{% set foo = foo|add(1) %}{{ foo|add(1) }}')(), '3', 'number variable remains a number after filter');
test.done();
}
});

0 comments on commit fe422d3

Please sign in to comment.