rustyrussell / ccan

The C Code Archive Network
http://ccodearchive.net/
1.07k stars 202 forks source link

JSON parser test failures #73

Open lod opened 6 years ago

lod commented 6 years ago

A JSON test suite has been produced which tests most commonly available JSON parsers against JSON corner cases http://seriot.ch/parsing_json.php https://github.com/nst/JSONTestSuite

These two test files are reported as causing the parser to crash. https://github.com/nst/JSONTestSuite/blob/master/test_parsing/n_structure_100000_opening_arrays.json https://github.com/nst/JSONTestSuite/blob/master/test_parsing/n_structure_open_array_object.json

These two test files are reported as being incorrectly parsed. https://github.com/nst/JSONTestSuite/blob/master/test_parsing/y_object_escaped_null_in_key.json https://github.com/nst/JSONTestSuite/blob/master/test_parsing/y_string_null_escape.json

I have not yet personally tested any of the tests.

lod commented 6 years ago

The two test files reported as incorrectly parsed are due to the presence of null characters.

Not supporting these seems to be a deliberate decision, presumably as doing otherwise would interfere with the standard string structure and be a pain to manage and use.

Explicitly documenting this variation from the standard would probably be worthwhile however.