aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/JsonSpec.js4
1 files changed, 4 insertions, 0 deletions
diff --git a/test/JsonSpec.js b/test/JsonSpec.js
index 6fc40e09..17bb97b6 100644
--- a/test/JsonSpec.js
+++ b/test/JsonSpec.js
@@ -100,6 +100,10 @@ describe('json', function(){
expect(fromJson("{value:2.55, name:'misko'}")).toEqual({value:2.55, name:'misko'});
});
+ it('should parse negative / possitve numbers', function() {
+ expect(fromJson("{neg:-2.55, pos:+.3, a:[-2, +.1, -.2, +.3]}")).toEqual({neg:-2.55, pos:+.3, a:[-2, +.1, -.2, +.3]});
+ });
+
describe('security', function(){
it('should not allow naked expressions', function(){
expect(function(){fromJson('1+2');}).toThrow("Did not understand '+2' while evaluating '1+2'.");