@@ -113,6 +113,9 @@ static void test_basic_parse(void)
113113 single_basic_parse ("\"\\udd27\"" , 0 );
114114 // Test with a "short" high surrogate
115115 single_basic_parse ("[9,'\\uDAD" , 0 );
116+ single_basic_parse ("\"[9,'\\uDAD\"" , 0 );
117+ // Test with a supplemental character that looks like a high surrogate
118+ single_basic_parse ("\"\\uD836\\uDE87\"" , 0 );
116119 single_basic_parse ("null" , 0 );
117120 single_basic_parse ("NaN" , 0 );
118121 single_basic_parse ("-NaN" , 0 ); /* non-sensical, returns null */
@@ -332,6 +335,11 @@ struct incremental_step
332335 {"{ \"foo" , -1 , -1 , json_tokener_continue , 1 , 0 },
333336 {": \"bar\"}" , -1 , 0 , json_tokener_error_parse_unexpected , 1 , 0 },
334337
338+ /* Check a supplemental code point that looks like a high surrogate */
339+ {"\"\\uD836" , -1 , -1 , json_tokener_continue , 0 , 0 },
340+ {"\\uDE87" , -1 , -1 , json_tokener_continue , 0 , 0 },
341+ {"\"" , -1 , -1 , json_tokener_success , 1 , 0 },
342+
335343 /* Check incremental parsing with trailing characters */
336344 {"{ \"foo" , -1 , -1 , json_tokener_continue , 0 , 0 },
337345 {"\": {\"bar" , -1 , -1 , json_tokener_continue , 0 , 0 },
0 commit comments