# define yajl_size_t size_t
# else
# define yajl_size_t unsigned int
+# define yajl_complete_parse yajl_parse_complete
# endif
#endif
if (yajl_parse(hand,
(const unsigned char *)jsonstring,
- strlen(jsonstring)) != yajl_status_ok) {
+ strlen(jsonstring)) != yajl_status_ok ||
+ yajl_complete_parse(hand) != yajl_status_ok) {
unsigned char *errstr = yajl_get_error(hand, 1,
(const unsigned char*)jsonstring,
strlen(jsonstring));
DO_TEST_PARSE("string", "[ \"The meaning of life\" ]");
DO_TEST_PARSE_FAIL("unterminated string", "[ \"The meaning of lif ]");
+ DO_TEST_PARSE("integer", "1");
+ DO_TEST_PARSE("boolean", "true");
+ DO_TEST_PARSE("null", "null");
+ DO_TEST_PARSE_FAIL("incomplete keyword", "tr");
+ DO_TEST_PARSE_FAIL("overdone keyword", "truest");
+ DO_TEST_PARSE_FAIL("unknown keyword", "huh");
DO_TEST_PARSE_FAIL("object with numeric keys", "{ 1:1, 2:1, 3:2 }");
DO_TEST_PARSE_FAIL("unterminated object", "{ \"1\":1, \"2\":1, \"3\":2");