From b814c79b58deeeeaa12b03261399ef80c0d6cc9f Mon Sep 17 00:00:00 2001 From: Misko Hevery Date: Thu, 25 Mar 2010 13:01:08 -0700 Subject: checkbox and radio now working --- test/ParserTest.js | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'test/ParserTest.js') diff --git a/test/ParserTest.js b/test/ParserTest.js index c8d323f2..d3813812 100644 --- a/test/ParserTest.js +++ b/test/ParserTest.js @@ -52,6 +52,16 @@ LexerTest.prototype.testTokenizeAString = function(){ assertEquals(tokens[i].string, 'd"e'); }; +LexerTest.prototype.testTokenizeUndefined = function(){ + var lexer = new Lexer("undefined"); + var tokens = lexer.parse(); + var i = 0; + assertEquals(tokens[i].index, 0); + assertEquals(tokens[i].text, 'undefined'); + assertEquals(undefined, tokens[i].fn()); +}; + + LexerTest.prototype.testTokenizeRegExp = function(){ var lexer = new Lexer("/r 1/"); @@ -486,3 +496,10 @@ ParserTest.prototype.testParsingBug = function () { var scope = new Scope(); assertEquals({a: "-"}, scope.eval("{a:'-'}")); }; + +ParserTest.prototype.testUndefined = function () { + var scope = new Scope(); + assertEquals(undefined, scope.eval("undefined")); + assertEquals(undefined, scope.eval("a=undefined")); + assertEquals(undefined, scope.get("a")); +}; -- cgit v1.2.3