blob: 97910dc0ff477b822de168cd0eaeb3bbf9cedd7e [file] [log] [blame]
Eric Haszlakiewiczc5c623a2012-03-31 22:51:39 -05001new_obj.to_string()="\u0003"
2new_obj.to_string()="foo"
3new_obj.to_string()="foo"
4new_obj.to_string()="ABC"
5new_obj.to_string()=null
6new_obj.to_string()=true
7new_obj.to_string()=12
8new_obj.to_string()=12.300000
9new_obj.to_string()=[ "\n" ]
10new_obj.to_string()=[ "\nabc\n" ]
11new_obj.to_string()=[ null ]
12new_obj.to_string()=[ ]
13new_obj.to_string()=[ false ]
14new_obj.to_string()=[ "abc", null, "def", 12 ]
15new_obj.to_string()={ }
16new_obj.to_string()={ "foo": "bar" }
17new_obj.to_string()={ "foo": "bar", "baz": null, "bool0": true }
18new_obj.to_string()={ "foo": [ null, "foo" ] }
19new_obj.to_string()={ "abc": 12, "foo": "bar", "bool0": false, "bool1": true, "arr": [ 1, 2, 3, null, 5 ] }
20==================================
21json_tokener_parse_versbose() OK
22==================================
23Starting incremental tests.
Eric Haszlakiewicz92f31bd2012-07-29 12:31:07 -050024Note: quotes and backslashes seen in the output here are literal values passed
25 to the parse functions. e.g. this is 4 characters: "\f"
Eric Haszlakiewiczc5c623a2012-03-31 22:51:39 -050026json_tokener_parse({ "foo) ... got error as expected
27json_tokener_parse_ex(tok, { "foo": 123 }, 14) ... OK: got object of type [object]: { "foo": 123 }
28json_tokener_parse_ex(tok, { "foo": 456 }, 14) ... OK: got object of type [object]: { "foo": 456 }
29json_tokener_parse_ex(tok, { "foo": 789 }, 14) ... OK: got object of type [object]: { "foo": 789 }
30json_tokener_parse_ex(tok, { "foo , 6) ... OK: got correct error: continue
31json_tokener_parse_ex(tok, ": {"bar , 8) ... OK: got correct error: continue
32json_tokener_parse_ex(tok, ":13}} , 6) ... OK: got object of type [object]: { "foo": { "bar": 13 } }
33json_tokener_parse_ex(tok, { "foo , 6) ... OK: got correct error: continue
34json_tokener_parse_ex(tok, : "bar"} , 8) ... OK: got correct error: unexpected character
35json_tokener_parse_ex(tok, { "foo , 6) ... OK: got correct error: continue
36json_tokener_parse_ex(tok, ": {"bar , 8) ... OK: got correct error: continue
37json_tokener_parse_ex(tok, ":13}}XXXX , 10) ... OK: got object of type [object]: { "foo": { "bar": 13 } }
38json_tokener_parse_ex(tok, XXXX , 4) ... OK: got correct error: unexpected character
39json_tokener_parse_ex(tok, {"x": 123 }"X", 14) ... OK: got object of type [object]: { "x": 123 }
40json_tokener_parse_ex(tok, "Y" , 3) ... OK: got object of type [string]: "Y"
41json_tokener_parse_ex(tok, 1 , 1) ... OK: got correct error: continue
42json_tokener_parse_ex(tok, 2 , 2) ... OK: got object of type [int]: 12
43json_tokener_parse_ex(tok, "blue" , 6) ... OK: got object of type [string]: "blue"
Eric Haszlakiewicz92f31bd2012-07-29 12:31:07 -050044json_tokener_parse_ex(tok, "\"" , 4) ... OK: got object of type [string]: "\""
45json_tokener_parse_ex(tok, "\\" , 4) ... OK: got object of type [string]: "\\"
46json_tokener_parse_ex(tok, "\b" , 4) ... OK: got object of type [string]: "\b"
47json_tokener_parse_ex(tok, "\f" , 4) ... OK: got object of type [string]: "\u000c"
48json_tokener_parse_ex(tok, "\n" , 4) ... OK: got object of type [string]: "\n"
49json_tokener_parse_ex(tok, "\r" , 4) ... OK: got object of type [string]: "\r"
50json_tokener_parse_ex(tok, "\t" , 4) ... OK: got object of type [string]: "\t"
Eric Haszlakiewiczc5c623a2012-03-31 22:51:39 -050051json_tokener_parse_ex(tok, [1,2,3] , 7) ... OK: got object of type [array]: [ 1, 2, 3 ]
52json_tokener_parse_ex(tok, [1,2,3,] , 8) ... OK: got object of type [array]: [ 1, 2, 3 ]
53json_tokener_parse_ex(tok, [1,2,,3,] , 9) ... OK: got correct error: unexpected character
Eric Haszlakiewicz92f31bd2012-07-29 12:31:07 -050054End Incremental Tests OK=27 ERROR=0
Eric Haszlakiewiczc5c623a2012-03-31 22:51:39 -050055==================================