From 3c10fb55807393ac6d22a247038871e1386f0b80 Mon Sep 17 00:00:00 2001 From: Gautham <41098605+ahgamut@users.noreply.github.com> Date: Tue, 12 Jul 2022 06:34:51 +0530 Subject: [PATCH] Fix quote escapes in JSON tests (#481) --- test/tool/net/samples/JSONTestSuite-fail1.lua | 128 ++++++++-------- test/tool/net/samples/JSONTestSuite-fail2.lua | 102 +++++++------ test/tool/net/samples/JSONTestSuite-fail3.lua | 2 - test/tool/net/samples/JSONTestSuite-fail4.lua | 138 ++++-------------- .../net/samples/JSONTestSuite-lenient.lua | Bin 10336 -> 14902 bytes test/tool/net/samples/JSONTestSuite-okay.lua | 69 +++++---- 6 files changed, 178 insertions(+), 261 deletions(-) diff --git a/test/tool/net/samples/JSONTestSuite-fail1.lua b/test/tool/net/samples/JSONTestSuite-fail1.lua index 8a592dc1a..8ac2bf8c4 100644 --- a/test/tool/net/samples/JSONTestSuite-fail1.lua +++ b/test/tool/net/samples/JSONTestSuite-fail1.lua @@ -31,172 +31,168 @@ -- ljson should reject all of them as invalid -- https://github.com/nst/JSONTestSuite/tree/d64aefb55228d9584d3e5b2433f720ea8fd00c82/test_parsing/n_object_no-colon.json -assert(false == pcall(DecodeJson, [[ {"a" ]])) +assert(false == pcall(DecodeJson, ' {"a" ')) -- https://github.com/nst/JSONTestSuite/tree/d64aefb55228d9584d3e5b2433f720ea8fd00c82/test_parsing/n_object_missing_value.json -assert(false == pcall(DecodeJson, [[ {"a": ]])) +assert(false == pcall(DecodeJson, ' {"a": ')) -- https://github.com/nst/JSONTestSuite/tree/d64aefb55228d9584d3e5b2433f720ea8fd00c82/test_parsing/n_object_missing_key.json -assert(false == pcall(DecodeJson, [[ {:"b"} ]])) +assert(false == pcall(DecodeJson, ' {:"b"} ')) -- https://github.com/nst/JSONTestSuite/tree/d64aefb55228d9584d3e5b2433f720ea8fd00c82/test_parsing/n_object_missing_colon.json -assert(false == pcall(DecodeJson, [[ {"a" b} ]])) - --- https://github.com/nst/JSONTestSuite/tree/d64aefb55228d9584d3e5b2433f720ea8fd00c82/test_parsing/n_object_lone_continuation_byte_in_key_and_trailing_comma.json - -- (converted to binary for safety) -assert(false == pcall(DecodeJson, [[ \x7b\x22\xb9\x22\x3a\x22\x30\x22\x2c\x7d ]])) +assert(false == pcall(DecodeJson, ' {"a" b} ')) -- https://github.com/nst/JSONTestSuite/tree/d64aefb55228d9584d3e5b2433f720ea8fd00c82/test_parsing/n_object_key_with_single_quotes.json -assert(false == pcall(DecodeJson, [[ {key: 'value'} ]])) +assert(false == pcall(DecodeJson, ' {key: \'value\'} ')) -- https://github.com/nst/JSONTestSuite/tree/d64aefb55228d9584d3e5b2433f720ea8fd00c82/test_parsing/n_object_garbage_at_end.json -assert(false == pcall(DecodeJson, [[ {"a":"a" 123} ]])) +assert(false == pcall(DecodeJson, ' {"a":"a" 123} ')) -- https://github.com/nst/JSONTestSuite/tree/d64aefb55228d9584d3e5b2433f720ea8fd00c82/test_parsing/n_object_emoji.json -- (converted to binary for safety) -assert(false == pcall(DecodeJson, [[ \x7b\xf0\x9f\x87\xa8\xf0\x9f\x87\xad\x7d ]])) +assert(false == pcall(DecodeJson, ' \x7b\xf0\x9f\x87\xa8\xf0\x9f\x87\xad\x7d ')) -- https://github.com/nst/JSONTestSuite/tree/d64aefb55228d9584d3e5b2433f720ea8fd00c82/test_parsing/n_object_bracket_key.json -assert(false == pcall(DecodeJson, [[ {[: "x"} ]])) +assert(false == pcall(DecodeJson, ' {[: "x"} ')) -- https://github.com/nst/JSONTestSuite/tree/d64aefb55228d9584d3e5b2433f720ea8fd00c82/test_parsing/n_number_with_alpha_char.json -assert(false == pcall(DecodeJson, [[ [1.8011670033376514H-308] ]])) +assert(false == pcall(DecodeJson, ' [1.8011670033376514H-308] ')) -- https://github.com/nst/JSONTestSuite/tree/d64aefb55228d9584d3e5b2433f720ea8fd00c82/test_parsing/n_number_with_alpha.json -assert(false == pcall(DecodeJson, [[ [1.2a-3] ]])) +assert(false == pcall(DecodeJson, ' [1.2a-3] ')) -- https://github.com/nst/JSONTestSuite/tree/d64aefb55228d9584d3e5b2433f720ea8fd00c82/test_parsing/n_number_starting_with_dot.json -assert(false == pcall(DecodeJson, [[ [.123] ]])) +assert(false == pcall(DecodeJson, ' [.123] ')) -- https://github.com/nst/JSONTestSuite/tree/d64aefb55228d9584d3e5b2433f720ea8fd00c82/test_parsing/n_number_real_with_invalid_utf8_after_e.json -- (converted to binary for safety) -assert(false == pcall(DecodeJson, [[ \x5b\x31\x65\xe5\x5d ]])) +assert(false == pcall(DecodeJson, ' \x5b\x31\x65\xe5\x5d ')) -- https://github.com/nst/JSONTestSuite/tree/d64aefb55228d9584d3e5b2433f720ea8fd00c82/test_parsing/n_number_real_garbage_after_e.json -assert(false == pcall(DecodeJson, [[ [1ea] ]])) +assert(false == pcall(DecodeJson, ' [1ea] ')) -- https://github.com/nst/JSONTestSuite/tree/d64aefb55228d9584d3e5b2433f720ea8fd00c82/test_parsing/n_number_neg_with_garbage_at_end.json -assert(false == pcall(DecodeJson, [[ [-1x] ]])) +assert(false == pcall(DecodeJson, ' [-1x] ')) -- https://github.com/nst/JSONTestSuite/tree/d64aefb55228d9584d3e5b2433f720ea8fd00c82/test_parsing/n_number_neg_real_without_int_part.json -assert(false == pcall(DecodeJson, [[ [-.123] ]])) +assert(false == pcall(DecodeJson, ' [-.123] ')) -- https://github.com/nst/JSONTestSuite/tree/d64aefb55228d9584d3e5b2433f720ea8fd00c82/test_parsing/n_number_minus_sign_with_trailing_garbage.json -assert(false == pcall(DecodeJson, [[ [-foo] ]])) +assert(false == pcall(DecodeJson, ' [-foo] ')) -- https://github.com/nst/JSONTestSuite/tree/d64aefb55228d9584d3e5b2433f720ea8fd00c82/test_parsing/n_number_minus_infinity.json -assert(false == pcall(DecodeJson, [[ [-Infinity] ]])) +assert(false == pcall(DecodeJson, ' [-Infinity] ')) -- https://github.com/nst/JSONTestSuite/tree/d64aefb55228d9584d3e5b2433f720ea8fd00c82/test_parsing/n_number_invalid-utf-8-in-int.json -- (converted to binary for safety) -assert(false == pcall(DecodeJson, [[ \x5b\x30\xe5\x5d ]])) +assert(false == pcall(DecodeJson, ' \x5b\x30\xe5\x5d ')) -- https://github.com/nst/JSONTestSuite/tree/d64aefb55228d9584d3e5b2433f720ea8fd00c82/test_parsing/n_number_invalid-utf-8-in-exponent.json -- (converted to binary for safety) -assert(false == pcall(DecodeJson, [[ \x5b\x31\x65\x31\xe5\x5d ]])) +assert(false == pcall(DecodeJson, ' \x5b\x31\x65\x31\xe5\x5d ')) -- https://github.com/nst/JSONTestSuite/tree/d64aefb55228d9584d3e5b2433f720ea8fd00c82/test_parsing/n_number_invalid-utf-8-in-bigger-int.json -- (converted to binary for safety) -assert(false == pcall(DecodeJson, [[ \x5b\x31\x32\x33\xe5\x5d ]])) +assert(false == pcall(DecodeJson, ' \x5b\x31\x32\x33\xe5\x5d ')) -- https://github.com/nst/JSONTestSuite/tree/d64aefb55228d9584d3e5b2433f720ea8fd00c82/test_parsing/n_number_invalid-negative-real.json -- (converted to binary for safety) -assert(false == pcall(DecodeJson, [[ \x5b\x2d\x31\x32\x33\x2e\x31\x32\x33\x66\x6f\x6f\x5d ]])) +assert(false == pcall(DecodeJson, ' \x5b\x2d\x31\x32\x33\x2e\x31\x32\x33\x66\x6f\x6f\x5d ')) -- https://github.com/nst/JSONTestSuite/tree/d64aefb55228d9584d3e5b2433f720ea8fd00c82/test_parsing/n_number_invalid+-.json -- (converted to binary for safety) -assert(false == pcall(DecodeJson, [[ \x5b\x30\x65\x2b\x2d\x31\x5d ]])) +assert(false == pcall(DecodeJson, ' \x5b\x30\x65\x2b\x2d\x31\x5d ')) -- https://github.com/nst/JSONTestSuite/tree/d64aefb55228d9584d3e5b2433f720ea8fd00c82/test_parsing/n_number_infinity.json -assert(false == pcall(DecodeJson, [[ [Infinity] ]])) +assert(false == pcall(DecodeJson, ' [Infinity] ')) -- https://github.com/nst/JSONTestSuite/tree/d64aefb55228d9584d3e5b2433f720ea8fd00c82/test_parsing/n_number_hex_2_digits.json -assert(false == pcall(DecodeJson, [[ [0x42] ]])) +assert(false == pcall(DecodeJson, ' [0x42] ')) -- https://github.com/nst/JSONTestSuite/tree/d64aefb55228d9584d3e5b2433f720ea8fd00c82/test_parsing/n_number_hex_1_digit.json -assert(false == pcall(DecodeJson, [[ [0x1] ]])) +assert(false == pcall(DecodeJson, ' [0x1] ')) -- https://github.com/nst/JSONTestSuite/tree/d64aefb55228d9584d3e5b2433f720ea8fd00c82/test_parsing/n_number_expression.json -assert(false == pcall(DecodeJson, [[ [1+2] ]])) +assert(false == pcall(DecodeJson, ' [1+2] ')) -- https://github.com/nst/JSONTestSuite/tree/d64aefb55228d9584d3e5b2433f720ea8fd00c82/test_parsing/n_number_U+FF11_fullwidth_digit_one.json -- (converted to binary for safety) -assert(false == pcall(DecodeJson, [[ \x5b\xef\xbc\x91\x5d ]])) +assert(false == pcall(DecodeJson, ' \x5b\xef\xbc\x91\x5d ')) -- https://github.com/nst/JSONTestSuite/tree/d64aefb55228d9584d3e5b2433f720ea8fd00c82/test_parsing/n_number_NaN.json -assert(false == pcall(DecodeJson, [[ [NaN] ]])) +assert(false == pcall(DecodeJson, ' [NaN] ')) -- https://github.com/nst/JSONTestSuite/tree/d64aefb55228d9584d3e5b2433f720ea8fd00c82/test_parsing/n_number_Inf.json -assert(false == pcall(DecodeJson, [[ [Inf] ]])) +assert(false == pcall(DecodeJson, ' [Inf] ')) -- https://github.com/nst/JSONTestSuite/tree/d64aefb55228d9584d3e5b2433f720ea8fd00c82/test_parsing/n_number_9.e+.json -assert(false == pcall(DecodeJson, [[ [9.e+] ]])) +assert(false == pcall(DecodeJson, ' [9.e+] ')) -- https://github.com/nst/JSONTestSuite/tree/d64aefb55228d9584d3e5b2433f720ea8fd00c82/test_parsing/n_number_1eE2.json -assert(false == pcall(DecodeJson, [[ [1eE2] ]])) +assert(false == pcall(DecodeJson, ' [1eE2] ')) -- https://github.com/nst/JSONTestSuite/tree/d64aefb55228d9584d3e5b2433f720ea8fd00c82/test_parsing/n_number_1.0e.json -assert(false == pcall(DecodeJson, [[ [1.0e] ]])) +assert(false == pcall(DecodeJson, ' [1.0e] ')) -- https://github.com/nst/JSONTestSuite/tree/d64aefb55228d9584d3e5b2433f720ea8fd00c82/test_parsing/n_number_1.0e-.json -assert(false == pcall(DecodeJson, [[ [1.0e-] ]])) +assert(false == pcall(DecodeJson, ' [1.0e-] ')) -- https://github.com/nst/JSONTestSuite/tree/d64aefb55228d9584d3e5b2433f720ea8fd00c82/test_parsing/n_number_1.0e+.json -assert(false == pcall(DecodeJson, [[ [1.0e+] ]])) +assert(false == pcall(DecodeJson, ' [1.0e+] ')) -- https://github.com/nst/JSONTestSuite/tree/d64aefb55228d9584d3e5b2433f720ea8fd00c82/test_parsing/n_number_0e.json -assert(false == pcall(DecodeJson, [[ [0e] ]])) +assert(false == pcall(DecodeJson, ' [0e] ')) -- https://github.com/nst/JSONTestSuite/tree/d64aefb55228d9584d3e5b2433f720ea8fd00c82/test_parsing/n_number_0e+.json -assert(false == pcall(DecodeJson, [[ [0e+] ]])) +assert(false == pcall(DecodeJson, ' [0e+] ')) -- https://github.com/nst/JSONTestSuite/tree/d64aefb55228d9584d3e5b2433f720ea8fd00c82/test_parsing/n_number_0_capital_E.json -assert(false == pcall(DecodeJson, [[ [0E] ]])) +assert(false == pcall(DecodeJson, ' [0E] ')) -- https://github.com/nst/JSONTestSuite/tree/d64aefb55228d9584d3e5b2433f720ea8fd00c82/test_parsing/n_number_0_capital_E+.json -assert(false == pcall(DecodeJson, [[ [0E+] ]])) +assert(false == pcall(DecodeJson, ' [0E+] ')) -- https://github.com/nst/JSONTestSuite/tree/d64aefb55228d9584d3e5b2433f720ea8fd00c82/test_parsing/n_number_0.3e.json -assert(false == pcall(DecodeJson, [[ [0.3e] ]])) +assert(false == pcall(DecodeJson, ' [0.3e] ')) -- https://github.com/nst/JSONTestSuite/tree/d64aefb55228d9584d3e5b2433f720ea8fd00c82/test_parsing/n_number_0.3e+.json -assert(false == pcall(DecodeJson, [[ [0.3e+] ]])) +assert(false == pcall(DecodeJson, ' [0.3e+] ')) -- https://github.com/nst/JSONTestSuite/tree/d64aefb55228d9584d3e5b2433f720ea8fd00c82/test_parsing/n_number_0.1.2.json -assert(false == pcall(DecodeJson, [[ [0.1.2] ]])) +assert(false == pcall(DecodeJson, ' [0.1.2] ')) -- https://github.com/nst/JSONTestSuite/tree/d64aefb55228d9584d3e5b2433f720ea8fd00c82/test_parsing/n_number_.2e-3.json -assert(false == pcall(DecodeJson, [[ [.2e-3] ]])) +assert(false == pcall(DecodeJson, ' [.2e-3] ')) -- https://github.com/nst/JSONTestSuite/tree/d64aefb55228d9584d3e5b2433f720ea8fd00c82/test_parsing/n_number_.-1.json -assert(false == pcall(DecodeJson, [[ [.-1] ]])) +assert(false == pcall(DecodeJson, ' [.-1] ')) -- https://github.com/nst/JSONTestSuite/tree/d64aefb55228d9584d3e5b2433f720ea8fd00c82/test_parsing/n_number_-NaN.json -assert(false == pcall(DecodeJson, [[ [-NaN] ]])) +assert(false == pcall(DecodeJson, ' [-NaN] ')) -- https://github.com/nst/JSONTestSuite/tree/d64aefb55228d9584d3e5b2433f720ea8fd00c82/test_parsing/n_number_-1.0..json -assert(false == pcall(DecodeJson, [[ [-1.0.] ]])) +assert(false == pcall(DecodeJson, ' [-1.0.] ')) -- https://github.com/nst/JSONTestSuite/tree/d64aefb55228d9584d3e5b2433f720ea8fd00c82/test_parsing/n_number_+Inf.json -assert(false == pcall(DecodeJson, [[ [+Inf] ]])) +assert(false == pcall(DecodeJson, ' [+Inf] ')) -- https://github.com/nst/JSONTestSuite/tree/d64aefb55228d9584d3e5b2433f720ea8fd00c82/test_parsing/n_number_+1.json -assert(false == pcall(DecodeJson, [[ [+1] ]])) +assert(false == pcall(DecodeJson, ' [+1] ')) -- https://github.com/nst/JSONTestSuite/tree/d64aefb55228d9584d3e5b2433f720ea8fd00c82/test_parsing/n_number_++.json -assert(false == pcall(DecodeJson, [[ [++1234] ]])) +assert(false == pcall(DecodeJson, ' [++1234] ')) -- https://github.com/nst/JSONTestSuite/tree/d64aefb55228d9584d3e5b2433f720ea8fd00c82/test_parsing/n_incomplete_true.json -assert(false == pcall(DecodeJson, [[ [tru] ]])) +assert(false == pcall(DecodeJson, ' [tru] ')) -- https://github.com/nst/JSONTestSuite/tree/d64aefb55228d9584d3e5b2433f720ea8fd00c82/test_parsing/n_incomplete_null.json -assert(false == pcall(DecodeJson, [[ [nul] ]])) +assert(false == pcall(DecodeJson, ' [nul] ')) -- https://github.com/nst/JSONTestSuite/tree/d64aefb55228d9584d3e5b2433f720ea8fd00c82/test_parsing/n_incomplete_false.json -assert(false == pcall(DecodeJson, [[ [fals] ]])) +assert(false == pcall(DecodeJson, ' [fals] ')) -- https://github.com/nst/JSONTestSuite/tree/d64aefb55228d9584d3e5b2433f720ea8fd00c82/test_parsing/n_array_unclosed_with_object_inside.json -assert(false == pcall(DecodeJson, [[ [{} ]])) +assert(false == pcall(DecodeJson, ' [{} ')) -- https://github.com/nst/JSONTestSuite/tree/d64aefb55228d9584d3e5b2433f720ea8fd00c82/test_parsing/n_array_unclosed_with_new_lines.json assert(false == pcall(DecodeJson, [[ @@ -205,17 +201,17 @@ assert(false == pcall(DecodeJson, [[ ,1 ]])) -- https://github.com/nst/JSONTestSuite/tree/d64aefb55228d9584d3e5b2433f720ea8fd00c82/test_parsing/n_array_unclosed_trailing_comma.json -assert(false == pcall(DecodeJson, [[ [1, ]])) +assert(false == pcall(DecodeJson, ' [1, ')) -- https://github.com/nst/JSONTestSuite/tree/d64aefb55228d9584d3e5b2433f720ea8fd00c82/test_parsing/n_array_unclosed.json -assert(false == pcall(DecodeJson, [[ ["" ]])) +assert(false == pcall(DecodeJson, ' ["" ')) -- https://github.com/nst/JSONTestSuite/tree/d64aefb55228d9584d3e5b2433f720ea8fd00c82/test_parsing/n_array_star_inside.json -assert(false == pcall(DecodeJson, [[ [*] ]])) +assert(false == pcall(DecodeJson, ' [*] ')) -- https://github.com/nst/JSONTestSuite/tree/d64aefb55228d9584d3e5b2433f720ea8fd00c82/test_parsing/n_array_spaces_vertical_tab_formfeed.json -- (converted to binary for safety) -assert(false == pcall(DecodeJson, [[ \x5b\x22\xb\x61\x22\x5c\x66\x5d ]])) +assert(false == pcall(DecodeJson, ' \x5b\x22\x0b\x61\x22\x5c\x66\x5d ')) -- https://github.com/nst/JSONTestSuite/tree/d64aefb55228d9584d3e5b2433f720ea8fd00c82/test_parsing/n_array_newlines_unclosed.json assert(false == pcall(DecodeJson, [[ @@ -224,22 +220,22 @@ assert(false == pcall(DecodeJson, [[ ,1, ]])) -- https://github.com/nst/JSONTestSuite/tree/d64aefb55228d9584d3e5b2433f720ea8fd00c82/test_parsing/n_array_items_separated_by_semicolon.json -assert(false == pcall(DecodeJson, [[ [1:2] ]])) +assert(false == pcall(DecodeJson, ' [1:2] ')) -- https://github.com/nst/JSONTestSuite/tree/d64aefb55228d9584d3e5b2433f720ea8fd00c82/test_parsing/n_array_invalid_utf8.json -- (converted to binary for safety) -assert(false == pcall(DecodeJson, [[ \x5b\xff\x5d ]])) +assert(false == pcall(DecodeJson, ' \x5b\xff\x5d ')) -- https://github.com/nst/JSONTestSuite/tree/d64aefb55228d9584d3e5b2433f720ea8fd00c82/test_parsing/n_array_incomplete_invalid_value.json -- (converted to binary for safety) -assert(false == pcall(DecodeJson, [[ \x5b\x78 ]])) +assert(false == pcall(DecodeJson, ' \x5b\x78 ')) -- https://github.com/nst/JSONTestSuite/tree/d64aefb55228d9584d3e5b2433f720ea8fd00c82/test_parsing/n_array_incomplete.json -assert(false == pcall(DecodeJson, [[ ["x" ]])) +assert(false == pcall(DecodeJson, ' ["x" ')) -- https://github.com/nst/JSONTestSuite/tree/d64aefb55228d9584d3e5b2433f720ea8fd00c82/test_parsing/n_array_colon_instead_of_comma.json -assert(false == pcall(DecodeJson, [[ ["": 1] ]])) +assert(false == pcall(DecodeJson, ' ["": 1] ')) -- https://github.com/nst/JSONTestSuite/tree/d64aefb55228d9584d3e5b2433f720ea8fd00c82/test_parsing/n_array_a_invalid_utf8.json -- (converted to binary for safety) -assert(false == pcall(DecodeJson, [[ \x5b\x61\xe5\x5d ]])) +assert(false == pcall(DecodeJson, ' \x5b\x61\xe5\x5d ')) diff --git a/test/tool/net/samples/JSONTestSuite-fail2.lua b/test/tool/net/samples/JSONTestSuite-fail2.lua index 590effcfd..67c08157a 100644 --- a/test/tool/net/samples/JSONTestSuite-fail2.lua +++ b/test/tool/net/samples/JSONTestSuite-fail2.lua @@ -32,127 +32,125 @@ -- ljson should reject all of them as invalid -- https://github.com/nst/JSONTestSuite/tree/d64aefb55228d9584d3e5b2433f720ea8fd00c82/test_parsing/n_structure_whitespace_formfeed.json - -- (converted to binary for safety) -assert(false == pcall(DecodeJson, [[ \x5b\xc\x5d ]])) +-- (converted to binary for safety) +assert(false == pcall(DecodeJson, ' \x5b\x0c\x5d ')) -- https://github.com/nst/JSONTestSuite/tree/d64aefb55228d9584d3e5b2433f720ea8fd00c82/test_parsing/n_structure_whitespace_U+2060_word_joiner.json - -- (converted to binary for safety) -assert(false == pcall(DecodeJson, [[ \x5b\xe2\x81\xa0\x5d ]])) +-- (converted to binary for safety) +assert(false == pcall(DecodeJson, ' \x5b\xe2\x81\xa0\x5d ')) -- https://github.com/nst/JSONTestSuite/tree/d64aefb55228d9584d3e5b2433f720ea8fd00c82/test_parsing/n_structure_unicode-identifier.json - -- (converted to binary for safety) -assert(false == pcall(DecodeJson, [[ \xc3\xa5 ]])) +-- (converted to binary for safety) +assert(false == pcall(DecodeJson, ' \xc3\xa5 ')) -- https://github.com/nst/JSONTestSuite/tree/d64aefb55228d9584d3e5b2433f720ea8fd00c82/test_parsing/n_structure_unclosed_object.json -assert(false == pcall(DecodeJson, [[ {"asd":"asd" ]])) +assert(false == pcall(DecodeJson, ' {"asd":"asd" ')) -- https://github.com/nst/JSONTestSuite/tree/d64aefb55228d9584d3e5b2433f720ea8fd00c82/test_parsing/n_structure_unclosed_array_unfinished_true.json -assert(false == pcall(DecodeJson, [[ [ false, tru ]])) +assert(false == pcall(DecodeJson, ' [ false, tru ')) -- https://github.com/nst/JSONTestSuite/tree/d64aefb55228d9584d3e5b2433f720ea8fd00c82/test_parsing/n_structure_unclosed_array_unfinished_false.json -assert(false == pcall(DecodeJson, [[ [ true, fals ]])) +assert(false == pcall(DecodeJson, ' [ true, fals ')) -- https://github.com/nst/JSONTestSuite/tree/d64aefb55228d9584d3e5b2433f720ea8fd00c82/test_parsing/n_structure_unclosed_array_partial_null.json -assert(false == pcall(DecodeJson, [[ [ false, nul ]])) +assert(false == pcall(DecodeJson, ' [ false, nul ')) -- https://github.com/nst/JSONTestSuite/tree/d64aefb55228d9584d3e5b2433f720ea8fd00c82/test_parsing/n_structure_unclosed_array.json -assert(false == pcall(DecodeJson, [[ [1 ]])) +assert(false == pcall(DecodeJson, ' [1 ')) -- https://github.com/nst/JSONTestSuite/tree/d64aefb55228d9584d3e5b2433f720ea8fd00c82/test_parsing/n_structure_uescaped_LF_before_string.json - -- (converted to binary for safety) -assert(false == pcall(DecodeJson, [[ \x5b\x5c\x75\x30\x30\x30\x41\x22\x22\x5d ]])) +-- (converted to binary for safety) +assert(false == pcall(DecodeJson, ' \x5b\x5c\x75\x30\x30\x30\x41\x22\x22\x5d ')) -- https://github.com/nst/JSONTestSuite/tree/d64aefb55228d9584d3e5b2433f720ea8fd00c82/test_parsing/n_structure_single_star.json -assert(false == pcall(DecodeJson, [[ * ]])) +assert(false == pcall(DecodeJson, ' * ')) -- https://github.com/nst/JSONTestSuite/tree/d64aefb55228d9584d3e5b2433f720ea8fd00c82/test_parsing/n_structure_single_eacute.json -assert(false == pcall(DecodeJson, [[ é ]])) +assert(false == pcall(DecodeJson, ' é ')) -- https://github.com/nst/JSONTestSuite/tree/d64aefb55228d9584d3e5b2433f720ea8fd00c82/test_parsing/n_structure_open_open.json -assert(false == pcall(DecodeJson, [[ ["\{["\{["\{["\{ ]])) +assert(false == pcall(DecodeJson, [[ ["{["{["{["{ ]])) -- https://github.com/nst/JSONTestSuite/tree/d64aefb55228d9584d3e5b2433f720ea8fd00c82/test_parsing/n_structure_open_object_string_with_apostrophes.json - -- (converted to binary for safety) -assert(false == pcall(DecodeJson, [[ \x7b\x27\x61\x27 ]])) +-- (converted to binary for safety) +assert(false == pcall(DecodeJson, ' \x7b\x27\x61\x27 ')) -- https://github.com/nst/JSONTestSuite/tree/d64aefb55228d9584d3e5b2433f720ea8fd00c82/test_parsing/n_structure_open_object_open_string.json - -- (converted to binary for safety) -assert(false == pcall(DecodeJson, [[ \x7b\x22\x61 ]])) +-- (converted to binary for safety) +assert(false == pcall(DecodeJson, ' \x7b\x22\x61 ')) -- https://github.com/nst/JSONTestSuite/tree/d64aefb55228d9584d3e5b2433f720ea8fd00c82/test_parsing/n_structure_open_object_open_array.json -assert(false == pcall(DecodeJson, [[ {[ ]])) +assert(false == pcall(DecodeJson, ' {[ ')) -- https://github.com/nst/JSONTestSuite/tree/d64aefb55228d9584d3e5b2433f720ea8fd00c82/test_parsing/n_structure_open_object_comma.json -assert(false == pcall(DecodeJson, [[ {, ]])) +assert(false == pcall(DecodeJson, ' {, ')) -- https://github.com/nst/JSONTestSuite/tree/d64aefb55228d9584d3e5b2433f720ea8fd00c82/test_parsing/n_structure_open_object_close_array.json -assert(false == pcall(DecodeJson, [[ {] ]])) +assert(false == pcall(DecodeJson, ' {] ')) -- https://github.com/nst/JSONTestSuite/tree/d64aefb55228d9584d3e5b2433f720ea8fd00c82/test_parsing/n_structure_open_object.json -assert(false == pcall(DecodeJson, [[ { ]])) +assert(false == pcall(DecodeJson, ' { ')) -- https://github.com/nst/JSONTestSuite/tree/d64aefb55228d9584d3e5b2433f720ea8fd00c82/test_parsing/n_structure_open_array_string.json - -- (converted to binary for safety) -assert(false == pcall(DecodeJson, [[ \x5b\x22\x61\x22 ]])) +-- (converted to binary for safety) +assert(false == pcall(DecodeJson, ' \x5b\x22\x61\x22 ')) -- https://github.com/nst/JSONTestSuite/tree/d64aefb55228d9584d3e5b2433f720ea8fd00c82/test_parsing/n_structure_open_array_open_string.json - -- (converted to binary for safety) -assert(false == pcall(DecodeJson, [[ \x5b\x22\x61 ]])) +-- (converted to binary for safety) +assert(false == pcall(DecodeJson, ' \x5b\x22\x61 ')) -- https://github.com/nst/JSONTestSuite/tree/d64aefb55228d9584d3e5b2433f720ea8fd00c82/test_parsing/n_structure_open_array_open_object.json -assert(false == pcall(DecodeJson, [[ [{ ]])) +assert(false == pcall(DecodeJson, ' [{ ')) -- https://github.com/nst/JSONTestSuite/tree/d64aefb55228d9584d3e5b2433f720ea8fd00c82/test_parsing/n_structure_open_array_comma.json -assert(false == pcall(DecodeJson, [[ [, ]])) +assert(false == pcall(DecodeJson, ' [, ')) -- https://github.com/nst/JSONTestSuite/tree/d64aefb55228d9584d3e5b2433f720ea8fd00c82/test_parsing/n_structure_open_array_apostrophe.json -assert(false == pcall(DecodeJson, [[ [' ]])) +assert(false == pcall(DecodeJson, ' [\' ')) -- https://github.com/nst/JSONTestSuite/tree/d64aefb55228d9584d3e5b2433f720ea8fd00c82/test_parsing/n_structure_object_with_comment.json -assert(false == pcall(DecodeJson, [[ {"a":/*comment*/"b"} ]])) +assert(false == pcall(DecodeJson, ' {"a":/*comment*/"b"} ')) -- https://github.com/nst/JSONTestSuite/tree/d64aefb55228d9584d3e5b2433f720ea8fd00c82/test_parsing/n_structure_object_unclosed_no_value.json -assert(false == pcall(DecodeJson, [[ {"": ]])) +assert(false == pcall(DecodeJson, ' {"": ')) -- https://github.com/nst/JSONTestSuite/tree/d64aefb55228d9584d3e5b2433f720ea8fd00c82/test_parsing/n_structure_null-byte-outside-string.json - -- (converted to binary for safety) -assert(false == pcall(DecodeJson, [[ \x5b\x0\x5d ]])) +-- (converted to binary for safety) +assert(false == pcall(DecodeJson, ' \x5b\x00\x5d ')) -- https://github.com/nst/JSONTestSuite/tree/d64aefb55228d9584d3e5b2433f720ea8fd00c82/test_parsing/n_structure_lone-open-bracket.json -assert(false == pcall(DecodeJson, [[ [ ]])) +assert(false == pcall(DecodeJson, ' [ ')) -- https://github.com/nst/JSONTestSuite/tree/d64aefb55228d9584d3e5b2433f720ea8fd00c82/test_parsing/n_structure_lone-invalid-utf-8.json - -- (converted to binary for safety) -assert(false == pcall(DecodeJson, [[ \xe5 ]])) +-- (converted to binary for safety) +assert(false == pcall(DecodeJson, ' \xe5 ')) -- https://github.com/nst/JSONTestSuite/tree/d64aefb55228d9584d3e5b2433f720ea8fd00c82/test_parsing/n_structure_incomplete_UTF8_BOM.json -assert(false == pcall(DecodeJson, [[ ï»{} ]])) +assert(false == pcall(DecodeJson, ' ï»{} ')) -- https://github.com/nst/JSONTestSuite/tree/d64aefb55228d9584d3e5b2433f720ea8fd00c82/test_parsing/n_structure_comma_instead_of_closing_brace.json -assert(false == pcall(DecodeJson, [[ {"x": true, ]])) +assert(false == pcall(DecodeJson, ' {"x": true, ')) -- https://github.com/nst/JSONTestSuite/tree/d64aefb55228d9584d3e5b2433f720ea8fd00c82/test_parsing/n_structure_capitalized_True.json -assert(false == pcall(DecodeJson, [[ [True] ]])) +assert(false == pcall(DecodeJson, ' [True] ')) -- https://github.com/nst/JSONTestSuite/tree/d64aefb55228d9584d3e5b2433f720ea8fd00c82/test_parsing/n_structure_ascii-unicode-identifier.json - -- (converted to binary for safety) -assert(false == pcall(DecodeJson, [[ \x61\xc3\xa5 ]])) +-- (converted to binary for safety) +assert(false == pcall(DecodeJson, ' \x61\xc3\xa5 ')) -- https://github.com/nst/JSONTestSuite/tree/d64aefb55228d9584d3e5b2433f720ea8fd00c82/test_parsing/n_structure_array_with_unclosed_string.json - -- (converted to binary for safety) -assert(false == pcall(DecodeJson, [[ \x5b\x22\x61\x73\x64\x5d ]])) +-- (converted to binary for safety) +assert(false == pcall(DecodeJson, ' \x5b\x22\x61\x73\x64\x5d ')) -- https://github.com/nst/JSONTestSuite/tree/d64aefb55228d9584d3e5b2433f720ea8fd00c82/test_parsing/n_structure_angle_bracket_null.json -assert(false == pcall(DecodeJson, [[ [] ]])) +assert(false == pcall(DecodeJson, ' [] ')) -- https://github.com/nst/JSONTestSuite/tree/d64aefb55228d9584d3e5b2433f720ea8fd00c82/test_parsing/n_structure_angle_bracket_..json -assert(false == pcall(DecodeJson, [[ <.> ]])) +assert(false == pcall(DecodeJson, ' <.> ')) -- https://github.com/nst/JSONTestSuite/tree/d64aefb55228d9584d3e5b2433f720ea8fd00c82/test_parsing/n_structure_UTF8_BOM_no_data.json -assert(false == pcall(DecodeJson, [[  ]])) +assert(false == pcall(DecodeJson, '  ')) -- https://github.com/nst/JSONTestSuite/tree/d64aefb55228d9584d3e5b2433f720ea8fd00c82/test_parsing/n_structure_U+2060_word_joined.json - -- (converted to binary for safety) -assert(false == pcall(DecodeJson, [[ \x5b\xe2\x81\xa0\x5d ]])) - - +-- (converted to binary for safety) +assert(false == pcall(DecodeJson, ' \x5b\xe2\x81\xa0\x5d ')) diff --git a/test/tool/net/samples/JSONTestSuite-fail3.lua b/test/tool/net/samples/JSONTestSuite-fail3.lua index 2b74fc0d4..4017d88ef 100644 --- a/test/tool/net/samples/JSONTestSuite-fail3.lua +++ b/test/tool/net/samples/JSONTestSuite-fail3.lua @@ -5663,5 +5663,3 @@ assert(false == pcall(DecodeJson, [[ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ ]])) - - diff --git a/test/tool/net/samples/JSONTestSuite-fail4.lua b/test/tool/net/samples/JSONTestSuite-fail4.lua index b219d3504..3b02d7356 100644 --- a/test/tool/net/samples/JSONTestSuite-fail4.lua +++ b/test/tool/net/samples/JSONTestSuite-fail4.lua @@ -30,144 +30,70 @@ -- these test cases are prefixed with n_ -- ljson should reject all of them as invalid --- https://github.com/nst/JSONTestSuite/tree/d64aefb55228d9584d3e5b2433f720ea8fd00c82/test_parsing/n_string_with_trailing_garbage.json - -- (converted to binary for safety) -assert(false == pcall(DecodeJson, [[ \x22\x22\x78 ]])) - --- https://github.com/nst/JSONTestSuite/tree/d64aefb55228d9584d3e5b2433f720ea8fd00c82/test_parsing/n_string_unicode_CapitalU.json - -- (converted to binary for safety) -assert(false == pcall(DecodeJson, [[ \x22\x5c\x55\x41\x36\x36\x44\x22 ]])) - --- https://github.com/nst/JSONTestSuite/tree/d64aefb55228d9584d3e5b2433f720ea8fd00c82/test_parsing/n_string_unescaped_tab.json - -- (converted to binary for safety) -assert(false == pcall(DecodeJson, [[ \x5b\x22\x9\x22\x5d ]])) - --- https://github.com/nst/JSONTestSuite/tree/d64aefb55228d9584d3e5b2433f720ea8fd00c82/test_parsing/n_string_unescaped_newline.json - -- (converted to binary for safety) -assert(false == pcall(DecodeJson, [[ \x5b\x22\x6e\x65\x77\xa\x6c\x69\x6e\x65\x22\x5d ]])) - --- https://github.com/nst/JSONTestSuite/tree/d64aefb55228d9584d3e5b2433f720ea8fd00c82/test_parsing/n_string_unescaped_ctrl_char.json - -- (converted to binary for safety) -assert(false == pcall(DecodeJson, [[ \x5b\x22\x61\x0\x61\x22\x5d ]])) - -- https://github.com/nst/JSONTestSuite/tree/d64aefb55228d9584d3e5b2433f720ea8fd00c82/test_parsing/n_string_start_escape_unclosed.json - -- (converted to binary for safety) -assert(false == pcall(DecodeJson, [[ \x5b\x22\x5c ]])) +-- (converted to binary for safety) +assert(false == pcall(DecodeJson, ' \x5b\x22\x5c ')) -- https://github.com/nst/JSONTestSuite/tree/d64aefb55228d9584d3e5b2433f720ea8fd00c82/test_parsing/n_string_single_string_no_double_quotes.json - -- (converted to binary for safety) -assert(false == pcall(DecodeJson, [[ \x61\x62\x63 ]])) +-- (converted to binary for safety) +assert(false == pcall(DecodeJson, ' \x61\x62\x63 ')) -- https://github.com/nst/JSONTestSuite/tree/d64aefb55228d9584d3e5b2433f720ea8fd00c82/test_parsing/n_string_single_quote.json - -- (converted to binary for safety) -assert(false == pcall(DecodeJson, [[ \x5b\x27\x73\x69\x6e\x67\x6c\x65\x20\x71\x75\x6f\x74\x65\x27\x5d ]])) - --- https://github.com/nst/JSONTestSuite/tree/d64aefb55228d9584d3e5b2433f720ea8fd00c82/test_parsing/n_string_single_doublequote.json - -- (converted to binary for safety) -assert(false == pcall(DecodeJson, [[ \x22 ]])) +-- (converted to binary for safety) +assert(false == pcall(DecodeJson, ' \x5b\x27\x73\x69\x6e\x67\x6c\x65\x20\x71\x75\x6f\x74\x65\x27\x5d ')) -- https://github.com/nst/JSONTestSuite/tree/d64aefb55228d9584d3e5b2433f720ea8fd00c82/test_parsing/n_string_no_quotes_with_bad_escape.json - -- (converted to binary for safety) -assert(false == pcall(DecodeJson, [[ \x5b\x5c\x6e\x5d ]])) +-- (converted to binary for safety) +assert(false == pcall(DecodeJson, ' \x5b\x5c\x6e\x5d ')) -- https://github.com/nst/JSONTestSuite/tree/d64aefb55228d9584d3e5b2433f720ea8fd00c82/test_parsing/n_string_leading_uescaped_thinspace.json - -- (converted to binary for safety) -assert(false == pcall(DecodeJson, [[ \x5b\x5c\x75\x30\x30\x32\x30\x22\x61\x73\x64\x22\x5d ]])) - --- https://github.com/nst/JSONTestSuite/tree/d64aefb55228d9584d3e5b2433f720ea8fd00c82/test_parsing/n_string_invalid_utf8_after_escape.json - -- (converted to binary for safety) -assert(false == pcall(DecodeJson, [[ \x5b\x22\x5c\xe5\x22\x5d ]])) - --- https://github.com/nst/JSONTestSuite/tree/d64aefb55228d9584d3e5b2433f720ea8fd00c82/test_parsing/n_string_invalid_unicode_escape.json - -- (converted to binary for safety) -assert(false == pcall(DecodeJson, [[ \x5b\x22\x5c\x75\x71\x71\x71\x71\x22\x5d ]])) - --- https://github.com/nst/JSONTestSuite/tree/d64aefb55228d9584d3e5b2433f720ea8fd00c82/test_parsing/n_string_invalid_backslash_esc.json - -- (converted to binary for safety) -assert(false == pcall(DecodeJson, [[ \x5b\x22\x5c\x61\x22\x5d ]])) - --- https://github.com/nst/JSONTestSuite/tree/d64aefb55228d9584d3e5b2433f720ea8fd00c82/test_parsing/n_string_invalid-utf-8-in-escape.json - -- (converted to binary for safety) -assert(false == pcall(DecodeJson, [[ \x5b\x22\x5c\x75\xe5\x22\x5d ]])) +-- (converted to binary for safety) +assert(false == pcall(DecodeJson, ' \x5b\x5c\x75\x30\x30\x32\x30\x22\x61\x73\x64\x22\x5d ')) -- https://github.com/nst/JSONTestSuite/tree/d64aefb55228d9584d3e5b2433f720ea8fd00c82/test_parsing/n_string_incomplete_surrogate_escape_invalid.json - -- (converted to binary for safety) -assert(false == pcall(DecodeJson, [[ \x5b\x22\x5c\x75\x44\x38\x30\x30\x5c\x75\x44\x38\x30\x30\x5c\x78\x22\x5d ]])) - --- https://github.com/nst/JSONTestSuite/tree/d64aefb55228d9584d3e5b2433f720ea8fd00c82/test_parsing/n_string_incomplete_surrogate.json - -- (converted to binary for safety) -assert(false == pcall(DecodeJson, [[ \x5b\x22\x5c\x75\x44\x38\x33\x34\x5c\x75\x44\x64\x22\x5d ]])) - --- https://github.com/nst/JSONTestSuite/tree/d64aefb55228d9584d3e5b2433f720ea8fd00c82/test_parsing/n_string_incomplete_escaped_character.json - -- (converted to binary for safety) -assert(false == pcall(DecodeJson, [[ \x5b\x22\x5c\x75\x30\x30\x41\x22\x5d ]])) +-- (converted to binary for safety) +assert(false == pcall(DecodeJson, ' \x5b\x22\x5c\x75\x44\x38\x30\x30\x5c\x75\x44\x38\x30\x30\x5c\x78\x22\x5d ')) -- https://github.com/nst/JSONTestSuite/tree/d64aefb55228d9584d3e5b2433f720ea8fd00c82/test_parsing/n_string_incomplete_escape.json - -- (converted to binary for safety) -assert(false == pcall(DecodeJson, [[ \x5b\x22\x5c\x22\x5d ]])) - --- https://github.com/nst/JSONTestSuite/tree/d64aefb55228d9584d3e5b2433f720ea8fd00c82/test_parsing/n_string_escaped_emoji.json - -- (converted to binary for safety) -assert(false == pcall(DecodeJson, [[ \x5b\x22\x5c\xf0\x9f\x8c\x80\x22\x5d ]])) - --- https://github.com/nst/JSONTestSuite/tree/d64aefb55228d9584d3e5b2433f720ea8fd00c82/test_parsing/n_string_escaped_ctrl_char_tab.json - -- (converted to binary for safety) -assert(false == pcall(DecodeJson, [[ \x5b\x22\x5c\x9\x22\x5d ]])) +-- (converted to binary for safety) +assert(false == pcall(DecodeJson, ' \x5b\x22\x5c\x22\x5d ')) -- https://github.com/nst/JSONTestSuite/tree/d64aefb55228d9584d3e5b2433f720ea8fd00c82/test_parsing/n_string_escaped_backslash_bad.json - -- (converted to binary for safety) -assert(false == pcall(DecodeJson, [[ \x5b\x22\x5c\x5c\x5c\x22\x5d ]])) +-- (converted to binary for safety) +assert(false == pcall(DecodeJson, ' \x5b\x22\x5c\x5c\x5c\x22\x5d ')) -- https://github.com/nst/JSONTestSuite/tree/d64aefb55228d9584d3e5b2433f720ea8fd00c82/test_parsing/n_string_escape_x.json - -- (converted to binary for safety) -assert(false == pcall(DecodeJson, [[ \x5b\x22\x5c\x78\x30\x30\x22\x5d ]])) - --- https://github.com/nst/JSONTestSuite/tree/d64aefb55228d9584d3e5b2433f720ea8fd00c82/test_parsing/n_string_backslash_00.json - -- (converted to binary for safety) -assert(false == pcall(DecodeJson, [[ \x5b\x22\x5c\x0\x22\x5d ]])) +-- (converted to binary for safety) +assert(false == pcall(DecodeJson, ' \x5b\x22\x5c\x78\x30\x30\x22\x5d ')) -- https://github.com/nst/JSONTestSuite/tree/d64aefb55228d9584d3e5b2433f720ea8fd00c82/test_parsing/n_string_accentuated_char_no_quotes.json - -- (converted to binary for safety) -assert(false == pcall(DecodeJson, [[ \x5b\xc3\xa9\x5d ]])) - --- https://github.com/nst/JSONTestSuite/tree/d64aefb55228d9584d3e5b2433f720ea8fd00c82/test_parsing/n_string_1_surrogate_then_escape_u1x.json - -- (converted to binary for safety) -assert(false == pcall(DecodeJson, [[ \x5b\x22\x5c\x75\x44\x38\x30\x30\x5c\x75\x31\x78\x22\x5d ]])) - --- https://github.com/nst/JSONTestSuite/tree/d64aefb55228d9584d3e5b2433f720ea8fd00c82/test_parsing/n_string_1_surrogate_then_escape_u1.json - -- (converted to binary for safety) -assert(false == pcall(DecodeJson, [[ \x5b\x22\x5c\x75\x44\x38\x30\x30\x5c\x75\x31\x22\x5d ]])) - --- https://github.com/nst/JSONTestSuite/tree/d64aefb55228d9584d3e5b2433f720ea8fd00c82/test_parsing/n_string_1_surrogate_then_escape_u.json - -- (converted to binary for safety) -assert(false == pcall(DecodeJson, [[ \x5b\x22\x5c\x75\x44\x38\x30\x30\x5c\x75\x22\x5d ]])) +-- (converted to binary for safety) +assert(false == pcall(DecodeJson, ' \x5b\xc3\xa9\x5d ')) -- https://github.com/nst/JSONTestSuite/tree/d64aefb55228d9584d3e5b2433f720ea8fd00c82/test_parsing/n_string_1_surrogate_then_escape.json - -- (converted to binary for safety) -assert(false == pcall(DecodeJson, [[ \x5b\x22\x5c\x75\x44\x38\x30\x30\x5c\x22\x5d ]])) +-- (converted to binary for safety) +assert(false == pcall(DecodeJson, ' \x5b\x22\x5c\x75\x44\x38\x30\x30\x5c\x22\x5d ')) -- https://github.com/nst/JSONTestSuite/tree/d64aefb55228d9584d3e5b2433f720ea8fd00c82/test_parsing/n_object_with_single_string.json - -- (converted to binary for safety) -assert(false == pcall(DecodeJson, [[ \x7b\x20\x22\x66\x6f\x6f\x22\x20\x3a\x20\x22\x62\x61\x72\x22\x2c\x20\x22\x61\x22\x20\x7d ]])) +-- (converted to binary for safety) +assert(false == pcall(DecodeJson, ' \x7b\x20\x22\x66\x6f\x6f\x22\x20\x3a\x20\x22\x62\x61\x72\x22\x2c\x20\x22\x61\x22\x20\x7d ')) -- https://github.com/nst/JSONTestSuite/tree/d64aefb55228d9584d3e5b2433f720ea8fd00c82/test_parsing/n_object_unterminated-value.json -assert(false == pcall(DecodeJson, [[ {"a":"a ]])) +assert(false == pcall(DecodeJson, ' {"a":"a ')) -- https://github.com/nst/JSONTestSuite/tree/d64aefb55228d9584d3e5b2433f720ea8fd00c82/test_parsing/n_object_unquoted_key.json -assert(false == pcall(DecodeJson, [[ {a: "b"} ]])) +assert(false == pcall(DecodeJson, ' {a: "b"} ')) -- https://github.com/nst/JSONTestSuite/tree/d64aefb55228d9584d3e5b2433f720ea8fd00c82/test_parsing/n_object_single_quote.json -assert(false == pcall(DecodeJson, [[ {'a':0} ]])) +assert(false == pcall(DecodeJson, ' {\'a\':0} ')) -- https://github.com/nst/JSONTestSuite/tree/d64aefb55228d9584d3e5b2433f720ea8fd00c82/test_parsing/n_object_repeated_null_null.json -assert(false == pcall(DecodeJson, [[ {null:null,null:null} ]])) +assert(false == pcall(DecodeJson, ' {null:null,null:null} ')) -- https://github.com/nst/JSONTestSuite/tree/d64aefb55228d9584d3e5b2433f720ea8fd00c82/test_parsing/n_object_non_string_key_but_huge_number_instead.json - -- (converted to binary for safety) -assert(false == pcall(DecodeJson, [[ \x7b\x39\x39\x39\x39\x45\x39\x39\x39\x39\x3a\x31\x7d ]])) +-- (converted to binary for safety) +assert(false == pcall(DecodeJson, ' \x7b\x39\x39\x39\x39\x45\x39\x39\x39\x39\x3a\x31\x7d ')) -- https://github.com/nst/JSONTestSuite/tree/d64aefb55228d9584d3e5b2433f720ea8fd00c82/test_parsing/n_object_non_string_key.json - -- (converted to binary for safety) -assert(false == pcall(DecodeJson, [[ \x7b\x31\x3a\x31\x7d ]])) - - +-- (converted to binary for safety) +assert(false == pcall(DecodeJson, ' \x7b\x31\x3a\x31\x7d ')) diff --git a/test/tool/net/samples/JSONTestSuite-lenient.lua b/test/tool/net/samples/JSONTestSuite-lenient.lua index 95d4f0bf4d2cfd456fbffa0efdb95e9f6193a8a1..b90f1a2c98a170de4d9232c2c68b5d7a7e101ce7 100644 GIT binary patch literal 14902 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 IR~