Browse Source

Improved testing for Infinity

pull/372/head
Jlguardi 8 years ago
parent
commit
431bd0c01e
2 changed files with 2 additions and 2 deletions
  1. +1
    -1
      tests/test_parse.c
  2. +1
    -1
      tests/test_parse.expected

+ 1
- 1
tests/test_parse.c View File

@@ -131,7 +131,7 @@ static void test_basic_parse()
printf("new_obj.to_string()=%s\n", json_object_to_json_string(new_obj)); printf("new_obj.to_string()=%s\n", json_object_to_json_string(new_obj));
json_object_put(new_obj); json_object_put(new_obj);


new_obj = json_tokener_parse("{ \"abc\": 12, \"foo\": \"bar\", \"bool0\": false, \"bool1\": true, \"arr\": [ 1, 2, 3, null, 5 ] }");
new_obj = json_tokener_parse("{ \"abc\": 12, \"foo\": \"bar\", \"bool0\": false, \"bool1\": true, \"arr\": [ 1, 2, 3, null, 5 ], \"inf\": Infinity, \"-inf\": -Infinity, \"nan\": NaN, \"def\" : -0.22, \"hij\": 0.31 }");
printf("new_obj.to_string()=%s\n", json_object_to_json_string(new_obj)); printf("new_obj.to_string()=%s\n", json_object_to_json_string(new_obj));
json_object_put(new_obj); json_object_put(new_obj);
} }


+ 1
- 1
tests/test_parse.expected View File

@@ -24,7 +24,7 @@ new_obj.to_string()={ }
new_obj.to_string()={ "foo": "bar" } new_obj.to_string()={ "foo": "bar" }
new_obj.to_string()={ "foo": "bar", "baz": null, "bool0": true } new_obj.to_string()={ "foo": "bar", "baz": null, "bool0": true }
new_obj.to_string()={ "foo": [ null, "foo" ] } new_obj.to_string()={ "foo": [ null, "foo" ] }
new_obj.to_string()={ "abc": 12, "foo": "bar", "bool0": false, "bool1": true, "arr": [ 1, 2, 3, null, 5 ] }
new_obj.to_string()={ "abc": 12, "foo": "bar", "bool0": false, "bool1": true, "arr": [ 1, 2, 3, null, 5 ], "inf": Infinity, "-inf": -Infinity, "nan": NaN, "def": -0.22, "hij": 0.31 }
================================== ==================================
json_tokener_parse_versbose() OK json_tokener_parse_versbose() OK
================================== ==================================


Loading…
Cancel
Save