aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/test_json.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/test_json.c b/tests/test_json.c
index e050c72..1aec8c5 100644
--- a/tests/test_json.c
+++ b/tests/test_json.c
@@ -216,3 +216,15 @@ i32 test_json_complex_multiline() {
return 0;
}
+
+i32 test_negative_numbers() {
+ Arena perm = Arena_new(128e3);
+ JSON doc = JSON_parse_raw(&perm, "[-1, -2.5]");
+
+ JSON integer = *Vec_get(doc.as.array, JSON, 0);
+ t_assert(integer.as.integer == -1);
+ JSON floating = *Vec_get(doc.as.array, JSON, 1);
+ t_assert(floating.as.floating == -2.5);
+
+ return 0;
+}