update json_test to be compliant with zig source encoding

See #663
master
Andrew Kelley 2018-05-25 02:08:43 -04:00
parent 3f302f8411
commit 56cb7f1740
1 changed files with 15 additions and 45 deletions

View File

@ -431,15 +431,11 @@ test "y_string_two-byte-utf-8" {
} }
test "y_string_u+2028_line_sep" { test "y_string_u+2028_line_sep" {
ok( ok("[\"\xe2\x80\xa8\"]");
\\[""]
);
} }
test "y_string_u+2029_par_sep" { test "y_string_u+2029_par_sep" {
ok( ok("[\"\xe2\x80\xa9\"]");
\\[""]
);
} }
test "y_string_uescaped_newline" { test "y_string_uescaped_newline" {
@ -455,9 +451,7 @@ test "y_string_uEscape" {
} }
test "y_string_unescaped_char_delete" { test "y_string_unescaped_char_delete" {
ok( ok("[\"\x7f\"]");
\\[""]
);
} }
test "y_string_unicode_2" { test "y_string_unicode_2" {
@ -527,9 +521,7 @@ test "y_string_utf8" {
} }
test "y_string_with_del_character" { test "y_string_with_del_character" {
ok( ok("[\"a\x7fa\"]");
\\["aa"]
);
} }
test "y_structure_lonely_false" { test "y_structure_lonely_false" {
@ -718,9 +710,7 @@ test "n_array_number_and_several_commas" {
} }
test "n_array_spaces_vertical_tab_formfeed" { test "n_array_spaces_vertical_tab_formfeed" {
err( err("[\"\x0aa\"\\f]");
\\[" a"\f]
);
} }
test "n_array_star_inside" { test "n_array_star_inside" {
@ -774,9 +764,7 @@ test "n_incomplete_true" {
} }
test "n_multidigit_number_then_00" { test "n_multidigit_number_then_00" {
err( err("123\x00");
\\123
);
} }
test "n_number_0.1.2" { test "n_number_0.1.2" {
@ -1309,9 +1297,7 @@ test "n_string_escaped_ctrl_char_tab" {
} }
test "n_string_escaped_emoji" { test "n_string_escaped_emoji" {
err( err("[\"\x5c\xc3\xb0\xc2\x9f\xc2\x8c\xc2\x80\"]");
\\["\🌀"]
);
} }
test "n_string_escape_x" { test "n_string_escape_x" {
@ -1357,9 +1343,7 @@ test "n_string_invalid_unicode_escape" {
} }
test "n_string_invalid_utf8_after_escape" { test "n_string_invalid_utf8_after_escape" {
err( err("[\"\\\x75\xc3\xa5\"]");
\\["\å"]
);
} }
test "n_string_invalid-utf-8-in-escape" { test "n_string_invalid-utf-8-in-escape" {
@ -1405,9 +1389,7 @@ test "n_string_start_escape_unclosed" {
} }
test "n_string_unescaped_crtl_char" { test "n_string_unescaped_crtl_char" {
err( err("[\"a\x00a\"]");
\\["aa"]
);
} }
test "n_string_unescaped_newline" { test "n_string_unescaped_newline" {
@ -1418,9 +1400,7 @@ test "n_string_unescaped_newline" {
} }
test "n_string_unescaped_tab" { test "n_string_unescaped_tab" {
err( err("[\"\t\"]");
\\[" "]
);
} }
test "n_string_unicode_CapitalU" { test "n_string_unicode_CapitalU" {
@ -1532,9 +1512,7 @@ test "n_structure_no_data" {
} }
test "n_structure_null-byte-outside-string" { test "n_structure_null-byte-outside-string" {
err( err("[\x00]");
\\[]
);
} }
test "n_structure_number_with_trailing_garbage" { test "n_structure_number_with_trailing_garbage" {
@ -1718,9 +1696,7 @@ test "n_structure_UTF8_BOM_no_data" {
} }
test "n_structure_whitespace_formfeed" { test "n_structure_whitespace_formfeed" {
err( err("[\x0c]");
\\[ ]
);
} }
test "n_structure_whitespace_U+2060_word_joiner" { test "n_structure_whitespace_U+2060_word_joiner" {
@ -1900,21 +1876,15 @@ test "i_string_truncated-utf-8" {
} }
test "i_string_utf16BE_no_BOM" { test "i_string_utf16BE_no_BOM" {
any( any("\x00\x5b\x00\x22\x00\xc3\xa9\x00\x22\x00\x5d");
\\["é"]
);
} }
test "i_string_utf16LE_no_BOM" { test "i_string_utf16LE_no_BOM" {
any( any("\x5b\x00\x22\x00\xc3\xa9\x00\x22\x00\x5d\x00");
\\["é"]
);
} }
test "i_string_UTF-16LE_with_BOM" { test "i_string_UTF-16LE_with_BOM" {
any( any("\xc3\xbf\xc3\xbe\x5b\x00\x22\x00\xc3\xa9\x00\x22\x00\x5d\x00");
\\ÿþ["é"]
);
} }
test "i_string_UTF-8_invalid_sequence" { test "i_string_UTF-8_invalid_sequence" {