paularmstrong/swig — Issue #27: tests are hardcoded to timezone
Author: gabrielfalcao
Created: 2011-12-26 05:03:27+00:00
State: open

I've forked the project looking forward contributing to it, although when I ran the tests, I got this output:

```bash

Starting speed tests...
object loop: 35ms
~ 28571 renders per sec.
array loop: 26ms
~ 38462 renders per sec.
Compile one template 1000 times: 2ms
~ 500000 renders per sec.
Render 1000 Includes Templates: 33ms
~ 30303 renders per sec.
Render 1000 Extends Templates: 32ms
~ 31250 renders per sec.

[1mfilters.test.js[22m
[31m✖ add[39m

Assertion Message: [35mstring var turns addend into a string[39m
AssertionError: 'NaN' === 'foo2'
at Object.strictEqual (/Users/gabrielfalcao/Dropbox/projects/personal/swig/node_modules/nodeunit/lib/types.js:83:39)
at testFilter (/Users/gabrielfalcao/Dropbox/projects/personal/swig/tests/filters.test.js:7:10)
at Object. (/Users/gabrielfalcao/Dropbox/projects/personal/swig/tests/filters.test.js:14:5)
at Object. (/Users/gabrielfalcao/Dropbox/projects/personal/swig/node_modules/nodeunit/lib/core.js:233:16)
at /Users/gabrielfalcao/Dropbox/projects/personal/swig/node_modules/nodeunit/lib/core.js:233:16
at Object.runTest (/Users/gabrielfalcao/Dropbox/projects/personal/swig/node_modules/nodeunit/lib/core.js:69:9)
at /Users/gabrielfalcao/Dropbox/projects/personal/swig/node_modules/nodeunit/lib/core.js:115:25
at /Users/gabrielfalcao/Dropbox/projects/personal/swig/node_modules/nodeunit/deps/async.js:508:13
at /Users/gabrielfalcao/Dropbox/projects/personal/swig/node_modules/nodeunit/deps/async.js:118:13
at /Users/gabrielfalcao/Dropbox/projects/personal/swig/node_modules/nodeunit/deps/async.js:134:9

Assertion Message: [35mstrings concatenated[39m
AssertionError: 'NaN' === 'foobar'
at Object.strictEqual (/Users/gabrielfalcao/Dropbox/projects/personal/swig/node_modules/nodeunit/lib/types.js:83:39)
at testFilter (/Users/gabrielfalcao/Dropbox/projects/personal/swig/tests/filters.test.js:7:10)
at Object. (/Users/gabrielfalcao/Dropbox/projects/personal/swig/tests/filters.test.js:15:5)
at Object. (/Users/gabrielfalcao/Dropbox/projects/personal/swig/node_modules/nodeunit/lib/core.js:233:16)
at /Users/gabrielfalcao/Dropbox/projects/personal/swig/node_modules/nodeunit/lib/core.js:233:16
at Object.runTest (/Users/gabrielfalcao/Dropbox/projects/personal/swig/node_modules/nodeunit/lib/core.js:69:9)
at /Users/gabrielfalcao/Dropbox/projects/personal/swig/node_modules/nodeunit/lib/core.js:115:25
at /Users/gabrielfalcao/Dropbox/projects/personal/swig/node_modules/nodeunit/deps/async.js:508:13
at /Users/gabrielfalcao/Dropbox/projects/personal/swig/node_modules/nodeunit/deps/async.js:118:13
at /Users/gabrielfalcao/Dropbox/projects/personal/swig/node_modules/nodeunit/deps/async.js:134:9

Assertion Message: [35madd array to string[39m
AssertionError: 'NaN' === 'foo1,2'
at Object.strictEqual (/Users/gabrielfalcao/Dropbox/projects/personal/swig/node_modules/nodeunit/lib/types.js:83:39)
at testFilter (/Users/gabrielfalcao/Dropbox/projects/personal/swig/tests/filters.test.js:7:10)
at Object. (/Users/gabrielfalcao/Dropbox/projects/personal/swig/tests/filters.test.js:18:5)
at Object. (/Users/gabrielfalcao/Dropbox/projects/personal/swig/node_modules/nodeunit/lib/core.js:233:16)
at /Users/gabrielfalcao/Dropbox/projects/personal/swig/node_modules/nodeunit/lib/core.js:233:16
at Object.runTest (/Users/gabrielfalcao/Dropbox/projects/personal/swig/node_modules/nodeunit/lib/core.js:69:9)
at /Users/gabrielfalcao/Dropbox/projects/personal/swig/node_modules/nodeunit/lib/core.js:115:25
at /Users/gabrielfalcao/Dropbox/projects/personal/swig/node_modules/nodeunit/deps/async.js:508:13
at /Users/gabrielfalcao/Dropbox/projects/personal/swig/node_modules/nodeunit/deps/async.js:118:13
at /Users/gabrielfalcao/Dropbox/projects/personal/swig/node_modules/nodeunit/deps/async.js:134:9

✔ addslashes
✔ capitalize
[31m✖ date[39m

AssertionError: '628' === '712'
at Object.strictEqual (/Users/gabrielfalcao/Dropbox/projects/personal/swig/node_modules/nodeunit/lib/types.js:83:39)
at testFilter (/Users/gabrielfalcao/Dropbox/projects/personal/swig/tests/filters.test.js:7:10)
at testFormat (/Users/gabrielfalcao/Dropbox/projects/personal/swig/tests/filters.test.js:40:9)
at Object. (/Users/gabrielfalcao/Dropbox/projects/personal/swig/tests/filters.test.js:75:5)
at Object. (/Users/gabrielfalcao/Dropbox/projects/personal/swig/node_modules/nodeunit/lib/core.js:233:16)
at /Users/gabrielfalcao/Dropbox/projects/personal/swig/node_modules/nodeunit/lib/core.js:233:16
at Object.runTest (/Users/gabrielfalcao/Dropbox/projects/personal/swig/node_modules/nodeunit/lib/core.js:69:9)
at /Users/gabrielfalcao/Dropbox/projects/personal/swig/node_modules/nodeunit/lib/core.js:115:25
at /Users/gabrielfalcao/Dropbox/projects/personal/swig/node_modules/nodeunit/deps/async.js:508:13
at /Users/gabrielfalcao/Dropbox/projects/personal/swig/node_modules/nodeunit/deps/async.js:118:13

AssertionError: '+0500' === '+0700'
at Object.strictEqual (/Users/gabrielfalcao/Dropbox/projects/personal/swig/node_modules/nodeunit/lib/types.js:83:39)
at testFilter (/Users/gabrielfalcao/Dropbox/projects/personal/swig/tests/filters.test.js:7:10)
at testFormat (/Users/gabrielfalcao/Dropbox/projects/personal/swig/tests/filters.test.js:40:9)
at Object. (/Users/gabrielfalcao/Dropbox/projects/personal/swig/tests/filters.test.js:86:5)
at Object. (/Users/gabrielfalcao/Dropbox/projects/personal/swig/node_modules/nodeunit/lib/core.js:233:16)
at /Users/gabrielfalcao/Dropbox/projects/personal/swig/node_modules/nodeunit/lib/core.js:233:16
at Object.runTest (/Users/gabrielfalcao/Dropbox/projects/personal/swig/node_modules/nodeunit/lib/core.js:69:9)
at /Users/gabrielfalcao/Dropbox/projects/personal/swig/node_modules/nodeunit/lib/core.js:115:25
at /Users/gabrielfalcao/Dropbox/projects/personal/swig/node_modules/nodeunit/deps/async.js:508:13
at /Users/gabrielfalcao/Dropbox/projects/personal/swig/node_modules/nodeunit/deps/async.js:118:13

AssertionError: '18000' === '25200'
at Object.strictEqual (/Users/gabrielfalcao/Dropbox/projects/personal/swig/node_modules/nodeunit/lib/types.js:83:39)
at testFilter (/Users/gabrielfalcao/Dropbox/projects/personal/swig/tests/filters.test.js:7:10)
at testFormat (/Users/gabrielfalcao/Dropbox/projects/personal/swig/tests/filters.test.js:40:9)
at Object. (/Users/gabrielfalcao/Dropbox/projects/personal/swig/tests/filters.test.js:87:5)
at Object. (/Users/gabrielfalcao/Dropbox/projects/personal/swig/node_modules/nodeunit/lib/core.js:233:16)
at /Users/gabrielfalcao/Dropbox/projects/personal/swig/node_modules/nodeunit/lib/core.js:233:16
at Object.runTest (/Users/gabrielfalcao/Dropbox/projects/personal/swig/node_modules/nodeunit/lib/core.js:69:9)
at /Users/gabrielfalcao/Dropbox/projects/personal/swig/node_modules/nodeunit/lib/core.js:115:25
at /Users/gabrielfalcao/Dropbox/projects/personal/swig/node_modules/nodeunit/deps/async.js:508:13
at /Users/gabrielfalcao/Dropbox/projects/personal/swig/node_modules/nodeunit/deps/async.js:118:13

AssertionError: '2011-09-06T14:05:02.000Z' === '2011-09-06T16:05:02.000Z'
at Object.strictEqual (/Users/gabrielfalcao/Dropbox/projects/personal/swig/node_modules/nodeunit/lib/types.js:83:39)
at testFilter (/Users/gabrielfalcao/Dropbox/projects/personal/swig/tests/filters.test.js:7:10)
at testFormat (/Users/gabrielfalcao/Dropbox/projects/personal/swig/tests/filters.test.js:40:9)
at Object. (/Users/gabrielfalcao/Dropbox/projects/personal/swig/tests/filters.test.js:90:5)
at Object. (/Users/gabrielfalcao/Dropbox/projects/personal/swig/node_modules/nodeunit/lib/core.js:233:16)
at /Users/gabrielfalcao/Dropbox/projects/personal/swig/node_modules/nodeunit/lib/core.js:233:16
at Object.runTest (/Users/gabrielfalcao/Dropbox/projects/personal/swig/node_modules/nodeunit/lib/core.js:69:9)
at /Users/gabrielfalcao/Dropbox/projects/personal/swig/node_modules/nodeunit/lib/core.js:115:25
at /Users/gabrielfalcao/Dropbox/projects/personal/swig/node_modules/nodeunit/deps/async.js:508:13
at /Users/gabrielfalcao/Dropbox/projects/personal/swig/node_modules/nodeunit/deps/async.js:118:13

AssertionError: 'Tue Sep 06 2011 09:05:02 GMT-0500 (EST)' === 'Tue Sep 06 2011 09:05:02 GMT-0700 (PDT)'
at Object.strictEqual (/Users/gabrielfalcao/Dropbox/projects/personal/swig/node_modules/nodeunit/lib/types.js:83:39)
at testFilter (/Users/gabrielfalcao/Dropbox/projects/personal/swig/tests/filters.test.js:7:10)
at testFormat (/Users/gabrielfalcao/Dropbox/projects/personal/swig/tests/filters.test.js:40:9)
at Object. (/Users/gabrielfalcao/Dropbox/projects/personal/swig/tests/filters.test.js:91:5)
at Object. (/Users/gabrielfalcao/Dropbox/projects/personal/swig/node_modules/nodeunit/lib/core.js:233:16)
at /Users/gabrielfalcao/Dropbox/projects/personal/swig/node_modules/nodeunit/lib/core.js:233:16
at Object.runTest (/Users/gabrielfalcao/Dropbox/projects/personal/swig/node_modules/nodeunit/lib/core.js:69:9)
at /Users/gabrielfalcao/Dropbox/projects/personal/swig/node_modules/nodeunit/lib/core.js:115:25
at /Users/gabrielfalcao/Dropbox/projects/personal/swig/node_modules/nodeunit/deps/async.js:508:13
at /Users/gabrielfalcao/Dropbox/projects/personal/swig/node_modules/nodeunit/deps/async.js:118:13

AssertionError: '1315317902' === '1315325102'
at Object.strictEqual (/Users/gabrielfalcao/Dropbox/projects/personal/swig/node_modules/nodeunit/lib/types.js:83:39)
at testFilter (/Users/gabrielfalcao/Dropbox/projects/personal/swig/tests/filters.test.js:7:10)
at testFormat (/Users/gabrielfalcao/Dropbox/projects/personal/swig/tests/filters.test.js:40:9)
at Object. (/Users/gabrielfalcao/Dropbox/projects/personal/swig/tests/filters.test.js:92:5)
at Object. (/Users/gabrielfalcao/Dropbox/projects/personal/swig/node_modules/nodeunit/lib/core.js:233:16)
at /Users/gabrielfalcao/Dropbox/projects/personal/swig/node_modules/nodeunit/lib/core.js:233:16
at Object.runTest (/Users/gabrielfalcao/Dropbox/projects/personal/swig/node_modules/nodeunit/lib/core.js:69:9)
at /Users/gabrielfalcao/Dropbox/projects/personal/swig/node_modules/nodeunit/lib/core.js:115:25
at /Users/gabrielfalcao/Dropbox/projects/personal/swig/node_modules/nodeunit/deps/async.js:508:13
at /Users/gabrielfalcao/Dropbox/projects/personal/swig/node_modules/nodeunit/deps/async.js:118:13

✔ default
✔ e
✔ escape
✔ first
✔ join
✔ json_encode
✔ length
✔ last
✔ lower
✔ raw
✔ replace
✔ reverse
✔ striptags
✔ title
✔ uniq
✔ upper
✔ url_encode
✔ url_decode

[1mhelpers.test.js[22m
✔ isLiteral
✔ isStringLiteral
✔ isValidName
✔ isValidShortName
✔ isValidBlockName

[1mindex.test.js[22m
✔ compileFile - basic
✔ compileFile - allowErrors = false
✔ compileFile - allowErrors = true
✔ compileFile - absolute path
✔ compileFile - throws on window

[1mparser.test.js[22m
✔ Tags - undefined tag throws error
✔ Tags - basic tag
✔ Tags - basic tag with ends
✔ Tags - line number included in token
✔ Tags - throws if requires end but no end found
✔ Tags - throws if not end but end found
✔ Tags - throws on unbalanced end tag
✔ Tags - tag with contents
✔ Tags - arguments
✔ Tags - bad string arguments throws
✔ Comments - empty strings are ignored
✔ Comments - comments are ignored
✔ Variable - basic variable
✔ Variable - dot-notation variable
✔ Variable - variable with filter
✔ Variable - multiple filters
✔ Variable - filters do not carry over
✔ Variable - filters with all kinds of characters in params
✔ Variable - escapements carry over in filter args
✔ Compiling - basic
✔ Compiling - throws if bad extends
✔ Compiling - throws if extends is not first token
✔ Compiling - block name requirements
✔ Compiling - block nesting

[1mtemplates.test.js[22m
✔ Errors - allow - parse error
✔ Errors - allow - compile error
✔ Errors - disallow - parse error
✔ Errors - disallow - compile error
✔ Variables - Filters
✔ Variables - Custom Filters
✔ Variables - notation
✔ double-escape forward-slash

[1mtags.test.js[22m
✔ custom tags
✔ autoescape - on
✔ autoescape - off
✔ autoescape - js
✔ extends - basic
✔ extends - circular
✔ include - basic
✔ include - variable
✔ if - basic
✔ if - errors
✔ if - var literals in tags allow filters
✔ if - else
✔ if - else if
✔ if - multiple else if and else
✔ for - basic
✔ for - variables
✔ for - index
✔ for - first
✔ for - last
✔ for - empty
✔ for - loop object allows filters
✔ set - basic
✔ set - from var
✔ set - array
✔ set - object
✔ macro - basic
✔ macro - args
✔ macro - complex
✔ macro - import
✔ macro - import in parent template
✔ filter - basic
✔ filter - complex content
✔ filter - args

[1m[31mFAILURES: [39m[22m9/295 assertions failed (374ms)
make: *** [test] Error 1
```