diff --git a/test/tool/net/samples/JSONTestSuite-okay.lua b/test/tool/net/samples/JSONTestSuite-okay.lua index bfb607fd4..ae78d71a3 100644 --- a/test/tool/net/samples/JSONTestSuite-okay.lua +++ b/test/tool/net/samples/JSONTestSuite-okay.lua @@ -33,103 +33,130 @@ -- but we run them anyway to check for segfaults -- https://github.com/nst/JSONTestSuite/tree/d64aefb55228d9584d3e5b2433f720ea8fd00c82/test_parsing/i_structure_UTF-8_BOM_empty_object.json -assert(nil ~= pcall(DecodeJson, [[ {} ]])) +-- (converted to binary for safety) +assert(nil ~= pcall(DecodeJson, [[ \xef\xbb\xbf{} ]])) -- https://github.com/nst/JSONTestSuite/tree/d64aefb55228d9584d3e5b2433f720ea8fd00c82/test_parsing/i_structure_500_nested_arrays.json -- (added spaces between [[ and ]] so lua doesn't get confused) -assert(nil ~= pcall(DecodeJson, [[ -[ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [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] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] +] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] +] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] +] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] +] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] +] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ]])) -- https://github.com/nst/JSONTestSuite/tree/d64aefb55228d9584d3e5b2433f720ea8fd00c82/test_parsing/i_string_utf16LE_no_BOM.json - -- (converted to binary for safety) +-- (converted to binary for safety) assert(nil ~= pcall(DecodeJson, [[ \x5b\x0\x22\x0\xe9\x0\x22\x0\x5d\x0 ]])) -- https://github.com/nst/JSONTestSuite/tree/d64aefb55228d9584d3e5b2433f720ea8fd00c82/test_parsing/i_string_utf16BE_no_BOM.json - -- (converted to binary for safety) +-- (converted to binary for safety) assert(nil ~= pcall(DecodeJson, [[ \x0\x5b\x0\x22\x0\xe9\x0\x22\x0\x5d ]])) -- https://github.com/nst/JSONTestSuite/tree/d64aefb55228d9584d3e5b2433f720ea8fd00c82/test_parsing/i_string_truncated-utf-8.json - -- (converted to binary for safety) +-- (converted to binary for safety) assert(nil ~= pcall(DecodeJson, [[ \x5b\x22\xe0\xff\x22\x5d ]])) -- https://github.com/nst/JSONTestSuite/tree/d64aefb55228d9584d3e5b2433f720ea8fd00c82/test_parsing/i_string_overlong_sequence_6_bytes_null.json - -- (converted to binary for safety) +-- (converted to binary for safety) assert(nil ~= pcall(DecodeJson, [[ \x5b\x22\xfc\x80\x80\x80\x80\x80\x22\x5d ]])) -- https://github.com/nst/JSONTestSuite/tree/d64aefb55228d9584d3e5b2433f720ea8fd00c82/test_parsing/i_string_overlong_sequence_6_bytes.json - -- (converted to binary for safety) +-- (converted to binary for safety) assert(nil ~= pcall(DecodeJson, [[ \x5b\x22\xfc\x83\xbf\xbf\xbf\xbf\x22\x5d ]])) -- https://github.com/nst/JSONTestSuite/tree/d64aefb55228d9584d3e5b2433f720ea8fd00c82/test_parsing/i_string_overlong_sequence_2_bytes.json - -- (converted to binary for safety) +-- (converted to binary for safety) assert(nil ~= pcall(DecodeJson, [[ \x5b\x22\xc0\xaf\x22\x5d ]])) -- https://github.com/nst/JSONTestSuite/tree/d64aefb55228d9584d3e5b2433f720ea8fd00c82/test_parsing/i_string_not_in_unicode_range.json - -- (converted to binary for safety) +-- (converted to binary for safety) assert(nil ~= pcall(DecodeJson, [[ \x5b\x22\xf4\xbf\xbf\xbf\x22\x5d ]])) -- https://github.com/nst/JSONTestSuite/tree/d64aefb55228d9584d3e5b2433f720ea8fd00c82/test_parsing/i_string_lone_utf8_continuation_byte.json - -- (converted to binary for safety) +-- (converted to binary for safety) assert(nil ~= pcall(DecodeJson, [[ \x5b\x22\x81\x22\x5d ]])) -- https://github.com/nst/JSONTestSuite/tree/d64aefb55228d9584d3e5b2433f720ea8fd00c82/test_parsing/i_string_lone_second_surrogate.json - -- (converted to binary for safety) +-- (converted to binary for safety) assert(nil ~= pcall(DecodeJson, [[ \x5b\x22\x5c\x75\x44\x46\x41\x41\x22\x5d ]])) -- https://github.com/nst/JSONTestSuite/tree/d64aefb55228d9584d3e5b2433f720ea8fd00c82/test_parsing/i_string_iso_latin_1.json - -- (converted to binary for safety) +-- (converted to binary for safety) assert(nil ~= pcall(DecodeJson, [[ \x5b\x22\xe9\x22\x5d ]])) -- https://github.com/nst/JSONTestSuite/tree/d64aefb55228d9584d3e5b2433f720ea8fd00c82/test_parsing/i_string_inverted_surrogates_U+1D11E.json - -- (converted to binary for safety) +-- (converted to binary for safety) assert(nil ~= pcall(DecodeJson, [[ \x5b\x22\x5c\x75\x44\x64\x31\x65\x5c\x75\x44\x38\x33\x34\x22\x5d ]])) -- https://github.com/nst/JSONTestSuite/tree/d64aefb55228d9584d3e5b2433f720ea8fd00c82/test_parsing/i_string_invalid_utf-8.json - -- (converted to binary for safety) +-- (converted to binary for safety) assert(nil ~= pcall(DecodeJson, [[ \x5b\x22\xff\x22\x5d ]])) -- https://github.com/nst/JSONTestSuite/tree/d64aefb55228d9584d3e5b2433f720ea8fd00c82/test_parsing/i_string_invalid_surrogate.json - -- (converted to binary for safety) +-- (converted to binary for safety) assert(nil ~= pcall(DecodeJson, [[ \x5b\x22\x5c\x75\x64\x38\x30\x30\x61\x62\x63\x22\x5d ]])) -- https://github.com/nst/JSONTestSuite/tree/d64aefb55228d9584d3e5b2433f720ea8fd00c82/test_parsing/i_string_invalid_lonely_surrogate.json - -- (converted to binary for safety) +-- (converted to binary for safety) assert(nil ~= pcall(DecodeJson, [[ \x5b\x22\x5c\x75\x64\x38\x30\x30\x22\x5d ]])) -- https://github.com/nst/JSONTestSuite/tree/d64aefb55228d9584d3e5b2433f720ea8fd00c82/test_parsing/i_string_incomplete_surrogates_escape_valid.json - -- (converted to binary for safety) +-- (converted to binary for safety) assert(nil ~= pcall(DecodeJson, [[ \x5b\x22\x5c\x75\x44\x38\x30\x30\x5c\x75\x44\x38\x30\x30\x5c\x6e\x22\x5d ]])) -- https://github.com/nst/JSONTestSuite/tree/d64aefb55228d9584d3e5b2433f720ea8fd00c82/test_parsing/i_string_incomplete_surrogate_pair.json - -- (converted to binary for safety) +-- (converted to binary for safety) assert(nil ~= pcall(DecodeJson, [[ \x5b\x22\x5c\x75\x44\x64\x31\x65\x61\x22\x5d ]])) -- https://github.com/nst/JSONTestSuite/tree/d64aefb55228d9584d3e5b2433f720ea8fd00c82/test_parsing/i_string_incomplete_surrogate_and_escape_valid.json - -- (converted to binary for safety) +-- (converted to binary for safety) assert(nil ~= pcall(DecodeJson, [[ \x5b\x22\x5c\x75\x44\x38\x30\x30\x5c\x6e\x22\x5d ]])) -- https://github.com/nst/JSONTestSuite/tree/d64aefb55228d9584d3e5b2433f720ea8fd00c82/test_parsing/i_string_UTF8_surrogate_U+D800.json - -- (converted to binary for safety) +-- (converted to binary for safety) assert(nil ~= pcall(DecodeJson, [[ \x5b\x22\xed\xa0\x80\x22\x5d ]])) -- https://github.com/nst/JSONTestSuite/tree/d64aefb55228d9584d3e5b2433f720ea8fd00c82/test_parsing/i_string_UTF-8_invalid_sequence.json - -- (converted to binary for safety) +-- (converted to binary for safety) assert(nil ~= pcall(DecodeJson, [[ \x5b\x22\xe6\x97\xa5\xd1\x88\xfa\x22\x5d ]])) -- https://github.com/nst/JSONTestSuite/tree/d64aefb55228d9584d3e5b2433f720ea8fd00c82/test_parsing/i_string_UTF-16LE_with_BOM.json - -- (converted to binary for safety) +-- (converted to binary for safety) assert(nil ~= pcall(DecodeJson, [[ \xff\xfe\x5b\x0\x22\x0\xe9\x0\x22\x0\x5d\x0 ]])) -- https://github.com/nst/JSONTestSuite/tree/d64aefb55228d9584d3e5b2433f720ea8fd00c82/test_parsing/i_string_1st_valid_surrogate_2nd_invalid.json - -- (converted to binary for safety) +-- (converted to binary for safety) assert(nil ~= pcall(DecodeJson, [[ \x5b\x22\x5c\x75\x44\x38\x38\x38\x5c\x75\x31\x32\x33\x34\x22\x5d ]])) -- https://github.com/nst/JSONTestSuite/tree/d64aefb55228d9584d3e5b2433f720ea8fd00c82/test_parsing/i_string_1st_surrogate_but_2nd_missing.json - -- (converted to binary for safety) +-- (converted to binary for safety) assert(nil ~= pcall(DecodeJson, [[ \x5b\x22\x5c\x75\x44\x41\x44\x41\x22\x5d ]])) -- https://github.com/nst/JSONTestSuite/tree/d64aefb55228d9584d3e5b2433f720ea8fd00c82/test_parsing/i_object_key_lone_2nd_surrogate.json -assert(nil ~= pcall(DecodeJson, [[ {"\uDFAA":0} ]])) +-- (converted to binary for safety) +assert(nil ~= pcall(DecodeJson, [[ \x7b\x22\x5c\x75\x44\x46\x41\x41\x22\x3a\x30\x7d ]])) + -- https://github.com/nst/JSONTestSuite/tree/d64aefb55228d9584d3e5b2433f720ea8fd00c82/test_parsing/i_number_very_big_negative_int.json assert(nil ~= pcall(DecodeJson, [[ [-237462374673276894279832749832423479823246327846] ]]))