Permalink
Browse files

Added test cases showing bug when dealing with number variables

  • Loading branch information...
1 parent 1300945 commit fe422d3db2dfc39d7dd202b097555bcabaf0bdd0 @imbcmdth committed Feb 18, 2012
Showing with 2 additions and 0 deletions.
  1. +2 −0 lib/tags/set.test.js
@@ -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.