summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorSerge A. Zaitsev <zaitsev.serge@gmail.com>2015-10-17 15:24:44 +0200
committerSerge A. Zaitsev <zaitsev.serge@gmail.com>2015-10-17 15:24:44 +0200
commitf7e6dcb7a2296386f251417e3fc259ef43abb41c (patch)
tree93471337eec64a1c1c5296bf4898bc0adceffb6c /test
parente5fb875b593447c33accaf3572c5b7bc662829d7 (diff)
added another test of invalid array
Diffstat (limited to 'test')
-rw-r--r--test/tests.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/test/tests.c b/test/tests.c
index b52a13c5d..4e4cc13fa 100644
--- a/test/tests.c
+++ b/test/tests.c
@@ -54,6 +54,12 @@ int test_object(void) {
check(parse("{\"a\": {2}}", JSMN_ERROR_INVAL, 3));
check(parse("{\"a\": {2: 3}}", JSMN_ERROR_INVAL, 3));
check(parse("{\"a\": {\"a\": 2 3}}", JSMN_ERROR_INVAL, 5));
+ check(parse("{\"a\"}", JSMN_ERROR_INVAL, 2));
+ check(parse("{\"a\": 1, \"b\"}", JSMN_ERROR_INVAL, 4));
+ check(parse("{\"a\",\"b\":1}", JSMN_ERROR_INVAL, 4));
+ check(parse("{\"a\":1,}", JSMN_ERROR_INVAL, 4));
+ check(parse("{\"a\":\"b\":\"c\"}", JSMN_ERROR_INVAL, 4));
+ check(parse("{,}", JSMN_ERROR_INVAL, 4));
#endif
return 0;
}