| Eric Haszlakiewicz | c5c623a | 2012-03-31 22:51:39 -0500 | [diff] [blame] | 1 | new_obj.to_string()="\u0003" |
| 2 | new_obj.to_string()="foo" |
| 3 | new_obj.to_string()="foo" |
| 4 | new_obj.to_string()="ABC" |
| 5 | new_obj.to_string()=null |
| 6 | new_obj.to_string()=true |
| 7 | new_obj.to_string()=12 |
| 8 | new_obj.to_string()=12.300000 |
| 9 | new_obj.to_string()=[ "\n" ] |
| 10 | new_obj.to_string()=[ "\nabc\n" ] |
| 11 | new_obj.to_string()=[ null ] |
| 12 | new_obj.to_string()=[ ] |
| 13 | new_obj.to_string()=[ false ] |
| 14 | new_obj.to_string()=[ "abc", null, "def", 12 ] |
| 15 | new_obj.to_string()={ } |
| 16 | new_obj.to_string()={ "foo": "bar" } |
| 17 | new_obj.to_string()={ "foo": "bar", "baz": null, "bool0": true } |
| 18 | new_obj.to_string()={ "foo": [ null, "foo" ] } |
| 19 | new_obj.to_string()={ "abc": 12, "foo": "bar", "bool0": false, "bool1": true, "arr": [ 1, 2, 3, null, 5 ] } |
| 20 | ================================== |
| 21 | json_tokener_parse_versbose() OK |
| 22 | ================================== |
| 23 | Starting incremental tests. |
| Eric Haszlakiewicz | 92f31bd | 2012-07-29 12:31:07 -0500 | [diff] [blame] | 24 | Note: 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 Haszlakiewicz | c5c623a | 2012-03-31 22:51:39 -0500 | [diff] [blame] | 26 | json_tokener_parse({ "foo) ... got error as expected |
| 27 | json_tokener_parse_ex(tok, { "foo": 123 }, 14) ... OK: got object of type [object]: { "foo": 123 } |
| 28 | json_tokener_parse_ex(tok, { "foo": 456 }, 14) ... OK: got object of type [object]: { "foo": 456 } |
| 29 | json_tokener_parse_ex(tok, { "foo": 789 }, 14) ... OK: got object of type [object]: { "foo": 789 } |
| 30 | json_tokener_parse_ex(tok, { "foo , 6) ... OK: got correct error: continue |
| 31 | json_tokener_parse_ex(tok, ": {"bar , 8) ... OK: got correct error: continue |
| 32 | json_tokener_parse_ex(tok, ":13}} , 6) ... OK: got object of type [object]: { "foo": { "bar": 13 } } |
| 33 | json_tokener_parse_ex(tok, { "foo , 6) ... OK: got correct error: continue |
| 34 | json_tokener_parse_ex(tok, : "bar"} , 8) ... OK: got correct error: unexpected character |
| 35 | json_tokener_parse_ex(tok, { "foo , 6) ... OK: got correct error: continue |
| 36 | json_tokener_parse_ex(tok, ": {"bar , 8) ... OK: got correct error: continue |
| 37 | json_tokener_parse_ex(tok, ":13}}XXXX , 10) ... OK: got object of type [object]: { "foo": { "bar": 13 } } |
| 38 | json_tokener_parse_ex(tok, XXXX , 4) ... OK: got correct error: unexpected character |
| 39 | json_tokener_parse_ex(tok, {"x": 123 }"X", 14) ... OK: got object of type [object]: { "x": 123 } |
| 40 | json_tokener_parse_ex(tok, "Y" , 3) ... OK: got object of type [string]: "Y" |
| 41 | json_tokener_parse_ex(tok, 1 , 1) ... OK: got correct error: continue |
| 42 | json_tokener_parse_ex(tok, 2 , 2) ... OK: got object of type [int]: 12 |
| 43 | json_tokener_parse_ex(tok, "blue" , 6) ... OK: got object of type [string]: "blue" |
| Eric Haszlakiewicz | 92f31bd | 2012-07-29 12:31:07 -0500 | [diff] [blame] | 44 | json_tokener_parse_ex(tok, "\"" , 4) ... OK: got object of type [string]: "\"" |
| 45 | json_tokener_parse_ex(tok, "\\" , 4) ... OK: got object of type [string]: "\\" |
| 46 | json_tokener_parse_ex(tok, "\b" , 4) ... OK: got object of type [string]: "\b" |
| Iskren Chernev | 78b089b | 2013-01-28 19:06:49 -0800 | [diff] [blame] | 47 | json_tokener_parse_ex(tok, "\f" , 4) ... OK: got object of type [string]: "\f" |
| Eric Haszlakiewicz | 92f31bd | 2012-07-29 12:31:07 -0500 | [diff] [blame] | 48 | json_tokener_parse_ex(tok, "\n" , 4) ... OK: got object of type [string]: "\n" |
| 49 | json_tokener_parse_ex(tok, "\r" , 4) ... OK: got object of type [string]: "\r" |
| 50 | json_tokener_parse_ex(tok, "\t" , 4) ... OK: got object of type [string]: "\t" |
| Eric Haszlakiewicz | c5c623a | 2012-03-31 22:51:39 -0500 | [diff] [blame] | 51 | json_tokener_parse_ex(tok, [1,2,3] , 7) ... OK: got object of type [array]: [ 1, 2, 3 ] |
| 52 | json_tokener_parse_ex(tok, [1,2,3,] , 8) ... OK: got object of type [array]: [ 1, 2, 3 ] |
| 53 | json_tokener_parse_ex(tok, [1,2,,3,] , 9) ... OK: got correct error: unexpected character |
| Eric Haszlakiewicz | 92f31bd | 2012-07-29 12:31:07 -0500 | [diff] [blame] | 54 | End Incremental Tests OK=27 ERROR=0 |
| Eric Haszlakiewicz | c5c623a | 2012-03-31 22:51:39 -0500 | [diff] [blame] | 55 | ================================== |