diff options
| author | Misko Hevery | 2010-08-10 11:46:12 -0700 |
|---|---|---|
| committer | Misko Hevery | 2010-08-10 11:46:12 -0700 |
| commit | 7673b2a2b291a4fc627e1cbdb8201f116a97b016 (patch) | |
| tree | 6c1c61dc7b88243edba8ec30c08fbaf9aa75f6e9 | |
| parent | 9b392eca3597fdc9dab81d88df75bef75f6e678f (diff) | |
| download | angular.js-7673b2a2b291a4fc627e1cbdb8201f116a97b016.tar.bz2 | |
added more tests for json float
| -rw-r--r-- | test/JsonTest.js | 4 | ||||
| -rw-r--r-- | test/ParserTest.js | 5 |
2 files changed, 9 insertions, 0 deletions
diff --git a/test/JsonTest.js b/test/JsonTest.js index 1ed56da8..4afb7743 100644 --- a/test/JsonTest.js +++ b/test/JsonTest.js @@ -82,3 +82,7 @@ JsonTest.prototype.testItShouldSerializeSameObjectsMultipleTimes = function () { JsonTest.prototype.testItShouldNotSerializeUndefinedValues = function () { assertEquals('{}', angular.toJson({A:undefined})); }; + +JsonTest.prototype.testItShouldParseFloats = function () { + expect(fromJson("{value:2.55, name:'misko'}")).toEqual({value:2.55, name:'misko'}); +}; diff --git a/test/ParserTest.js b/test/ParserTest.js index 7ba65f18..d7fd2f94 100644 --- a/test/ParserTest.js +++ b/test/ParserTest.js @@ -147,6 +147,11 @@ LexerTest.prototype.testStatements = function(){ assertEquals(tokens[3].text, ';'); }; +LexerTest.prototype.testNumber = function(){ + var tokens = new Lexer("0.5").parse(); + expect(tokens[0].text).toEqual(0.5); +}; + ParserTest = TestCase('ParserTest'); ParserTest.prototype.testExpressions = function(){ |
