Issue#102 - add support for parsing "NaN".

This commit is contained in:
Eric Haszlakiewicz
2014-03-09 16:41:33 -04:00
parent e6f1322b5e
commit 0eedf3802f
6 changed files with 44 additions and 10 deletions

View File

@@ -47,6 +47,10 @@ static void test_basic_parse()
printf("new_obj.to_string()=%s\n", json_object_to_json_string(new_obj));
json_object_put(new_obj);
new_obj = json_tokener_parse("NaN");
printf("new_obj.to_string()=%s\n", json_object_to_json_string(new_obj));
json_object_put(new_obj);
new_obj = json_tokener_parse("True");
printf("new_obj.to_string()=%s\n", json_object_to_json_string(new_obj));
json_object_put(new_obj);

View File

@@ -3,6 +3,7 @@ new_obj.to_string()="foo"
new_obj.to_string()="foo"
new_obj.to_string()="ABC"
new_obj.to_string()=null
new_obj.to_string()=NaN
new_obj.to_string()=true
new_obj.to_string()=12
new_obj.to_string()=12.3