From e395ad562e83e6db07b88cb595cb676f6ffe8420 Mon Sep 17 00:00:00 2001 From: "Serge A. Zaitsev" Date: Wed, 1 Feb 2012 17:18:32 +0200 Subject: [PATCH] added one more test case for partial string parser --- jsmn_test.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/jsmn_test.c b/jsmn_test.c index b01e6c2..17019c8 100644 --- a/jsmn_test.c +++ b/jsmn_test.c @@ -171,6 +171,16 @@ int test_partial_string() { check(TOKEN_STIRNG(js, tok[0], "x")); check(TOKEN_STIRNG(js, tok[1], "value")); + js = "\"x\": \"value\", \"y\": \"value y\""; + r = jsmn_parse(&p, js, tok, 10); + check(r == JSMN_SUCCESS && tok[0].type == JSMN_STRING + && tok[1].type == JSMN_STRING && tok[2].type == JSMN_STRING + && tok[3].type == JSMN_STRING); + check(TOKEN_STIRNG(js, tok[0], "x")); + check(TOKEN_STIRNG(js, tok[1], "value")); + check(TOKEN_STIRNG(js, tok[2], "y")); + check(TOKEN_STIRNG(js, tok[3], "value y")); + return 0; }