mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-06-04 03:32:27 +00:00
Rename json test files to avoid build tuning
This commit is contained in:
parent
3f3e7e92d7
commit
6d52664aa7
11 changed files with 1 additions and 5 deletions
64
test/tool/net/jsonorg_lenient_test.lua
Normal file
64
test/tool/net/jsonorg_lenient_test.lua
Normal file
|
@ -0,0 +1,64 @@
|
|||
-- json.org says the following test cases should be
|
||||
-- considered as invalid JSON, but ljson.c is lenient.
|
||||
-- we run these tests anyway just to ensure that
|
||||
-- no segfaults occurs while parsing these cases
|
||||
|
||||
-- https://www.json.org/JSON_checker/test.zip
|
||||
-- JSON parsing sample test case: fail4.json
|
||||
assert(DecodeJson([[
|
||||
[ "extra comma",]
|
||||
]]))
|
||||
|
||||
-- [jart] we deviate from json.org because we don't care about commas
|
||||
-- https://www.json.org/JSON_checker/test.zip
|
||||
-- JSON parsing sample test case: fail5.json
|
||||
assert(DecodeJson([[
|
||||
[ "double extra comma",,]
|
||||
]]))
|
||||
|
||||
-- [jart] we deviate from json.org because we don't care about commas
|
||||
-- https://www.json.org/JSON_checker/test.zip
|
||||
-- JSON parsing sample test case: fail6.json
|
||||
assert(DecodeJson([[
|
||||
[ , "<-- missing value"]
|
||||
]]))
|
||||
|
||||
-- [jart] we deviate from json.org because we don't care about commas
|
||||
-- https://www.json.org/JSON_checker/test.zip
|
||||
-- JSON parsing sample test case: fail9.json
|
||||
assert(DecodeJson([[
|
||||
{"Extra comma": true,}
|
||||
]]))
|
||||
|
||||
-- [jart] we deviate from json.org because we don't care about colons
|
||||
-- https://www.json.org/JSON_checker/test.zip
|
||||
-- JSON parsing sample test case: fail19.json
|
||||
assert(DecodeJson([[
|
||||
{"Missing colon" null}
|
||||
]]))
|
||||
|
||||
-- [jart] we deviate from json.org because we don't care about colons
|
||||
-- https://www.json.org/JSON_checker/test.zip
|
||||
-- JSON parsing sample test case: fail20.json
|
||||
assert(DecodeJson([[
|
||||
{"Double colon":: null}
|
||||
]]))
|
||||
|
||||
-- https://www.json.org/JSON_checker/test.zip
|
||||
-- JSON parsing sample test case: fail25.json
|
||||
assert(not DecodeJson([[
|
||||
[ " tab character in string "]
|
||||
]]))
|
||||
|
||||
-- https://www.json.org/JSON_checker/test.zip
|
||||
-- JSON parsing sample test case: fail27.json
|
||||
assert(not DecodeJson([[
|
||||
[ "line
|
||||
break"]
|
||||
]]))
|
||||
|
||||
-- https://www.json.org/JSON_checker/test.zip
|
||||
-- JSON parsing sample test case: fail15.json
|
||||
assert(not DecodeJson([[
|
||||
[ "Illegal backslash escape: \x15"]
|
||||
]]))
|
Loading…
Add table
Add a link
Reference in a new issue