single_basic_parse("\"\\udd27\"", 0);
// Test with a "short" high surrogate
single_basic_parse("[9,'\\uDAD", 0);
+ single_basic_parse("\"[9,'\\uDAD\"", 0);
+ // Test with a supplemental character that looks like a high surrogate
+ single_basic_parse("\"\\uD836\\uDE87\"", 0);
single_basic_parse("null", 0);
single_basic_parse("NaN", 0);
single_basic_parse("-NaN", 0); /* non-sensical, returns null */
{"{ \"foo", -1, -1, json_tokener_continue, 1, 0},
{": \"bar\"}", -1, 0, json_tokener_error_parse_unexpected, 1, 0},
+ /* Check a supplemental code point that looks like a high surrogate */
+ {"\"\\uD836", -1, -1, json_tokener_continue, 0, 0},
+ {"\\uDE87", -1, -1, json_tokener_continue, 0, 0},
+ {"\"", -1, -1, json_tokener_success, 1, 0},
+
/* Check incremental parsing with trailing characters */
{"{ \"foo", -1, -1, json_tokener_continue, 0, 0},
{"\": {\"bar", -1, -1, json_tokener_continue, 0, 0},
new_obj.to_string("\ud840")="�"
new_obj.to_string("\udd27")="�"
new_obj.to_string([9,'\uDAD)=null
+new_obj.to_string("[9,'\uDAD")=null
+new_obj.to_string("\uD836\uDE87")="�"
new_obj.to_string(null)=null
new_obj.to_string(NaN)=NaN
new_obj.to_string(-NaN)=null
json_tokener_parse_ex(tok, "ä" , 4) ... OK: got object of type [string]: "ä"
json_tokener_parse_ex(tok, { "foo , 6) ... OK: got correct error: continue
json_tokener_parse_ex(tok, : "bar"} , 8) ... OK: got correct error: unexpected character
+json_tokener_parse_ex(tok, "\uD836 , 7) ... OK: got correct error: continue
+json_tokener_parse_ex(tok, \uDE87 , 6) ... OK: got correct error: continue
+json_tokener_parse_ex(tok, " , 1) ... OK: got object of type [string]: "�"
json_tokener_parse_ex(tok, { "foo , 6) ... OK: got correct error: continue
json_tokener_parse_ex(tok, ": {"bar , 8) ... OK: got correct error: continue
json_tokener_parse_ex(tok, ":13}}XXXX , 10) ... OK: got object of type [object]: { "foo": { "bar": 13 } }
json_tokener_parse_ex(tok, {"\1d":1} , 7) ... OK: got correct error: invalid string sequence
json_tokener_parse_ex(tok, {"\1e":1} , 7) ... OK: got correct error: invalid string sequence
json_tokener_parse_ex(tok, {"\1f":1} , 7) ... OK: got correct error: invalid string sequence
-End Incremental Tests OK=269 ERROR=0
+End Incremental Tests OK=272 ERROR=0
==================================