From ac26ea9c5bb42bd19aa466acea830a90435d65de Mon Sep 17 00:00:00 2001 From: Eric Haszlakiewicz Date: Sun, 10 Nov 2019 00:10:28 -0500 Subject: [PATCH] Add a test for serializing the double value -1.0. --- tests/test_float.c | 4 ++++ tests/test_float.expected | 1 + 2 files changed, 5 insertions(+) diff --git a/tests/test_float.c b/tests/test_float.c index 0a87038..7c082ea 100644 --- a/tests/test_float.c +++ b/tests/test_float.c @@ -11,6 +11,10 @@ int main(void) json = json_object_new_double(1.0); printf("json = %s\n", json_object_to_json_string_ext(json, JSON_C_TO_STRING_PRETTY)); json_object_put(json); + + json = json_object_new_double(-1.0); + printf("json = %s\n", json_object_to_json_string_ext(json, JSON_C_TO_STRING_PRETTY)); + json_object_put(json); json = json_object_new_double(1.23); printf("json = %s\n", json_object_to_json_string_ext(json, JSON_C_TO_STRING_PRETTY)); json_object_put(json); diff --git a/tests/test_float.expected b/tests/test_float.expected index 970c654..7ca5916 100644 --- a/tests/test_float.expected +++ b/tests/test_float.expected @@ -1,4 +1,5 @@ json = 1.0 +json = -1.0 json = 1.23 json = 123456789.0 json = 123456789.123 -- 2.49.0