From 431bd0c01ecb630f18ae3e15e8d014d931e355cd Mon Sep 17 00:00:00 2001 From: Jlguardi Date: Fri, 3 Nov 2017 09:51:16 +0100 Subject: [PATCH] Improved testing for Infinity --- tests/test_parse.c | 2 +- tests/test_parse.expected | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/test_parse.c b/tests/test_parse.c index 8808d0f..f6b5c03 100644 --- a/tests/test_parse.c +++ b/tests/test_parse.c @@ -131,7 +131,7 @@ 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("{ \"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)); json_object_put(new_obj); } diff --git a/tests/test_parse.expected b/tests/test_parse.expected index d49cbbb..b8badda 100644 --- a/tests/test_parse.expected +++ b/tests/test_parse.expected @@ -24,7 +24,7 @@ new_obj.to_string()={ } new_obj.to_string()={ "foo": "bar" } new_obj.to_string()={ "foo": "bar", "baz": null, "bool0": true } 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 ==================================