Merge branch 'testsuite' into feature/sax2
This commit is contained in:
commit
717301d1bc
321 changed files with 813 additions and 0 deletions
test/data/nst_json_testsuite2
LICENSEREADME.md
test_parsing
i_number_double_huge_neg_exp.jsoni_number_huge_exp.jsoni_number_neg_int_huge_exp.jsoni_number_pos_double_huge_exp.jsoni_number_real_neg_overflow.jsoni_number_real_pos_overflow.jsoni_number_real_underflow.jsoni_number_too_big_neg_int.jsoni_number_too_big_pos_int.jsoni_number_very_big_negative_int.jsoni_object_key_lone_2nd_surrogate.jsoni_string_1st_surrogate_but_2nd_missing.jsoni_string_1st_valid_surrogate_2nd_invalid.jsoni_string_UTF-16LE_with_BOM.jsoni_string_UTF-8_invalid_sequence.jsoni_string_UTF8_surrogate_U+D800.jsoni_string_incomplete_surrogate_and_escape_valid.jsoni_string_incomplete_surrogate_pair.jsoni_string_incomplete_surrogates_escape_valid.jsoni_string_invalid_lonely_surrogate.jsoni_string_invalid_surrogate.jsoni_string_invalid_utf-8.jsoni_string_inverted_surrogates_U+1D11E.jsoni_string_iso_latin_1.jsoni_string_lone_second_surrogate.jsoni_string_lone_utf8_continuation_byte.jsoni_string_not_in_unicode_range.jsoni_string_overlong_sequence_2_bytes.jsoni_string_overlong_sequence_6_bytes.jsoni_string_overlong_sequence_6_bytes_null.jsoni_string_truncated-utf-8.jsoni_string_utf16BE_no_BOM.jsoni_string_utf16LE_no_BOM.jsoni_structure_500_nested_arrays.jsoni_structure_UTF-8_BOM_empty_object.jsonn_array_1_true_without_comma.jsonn_array_a_invalid_utf8.jsonn_array_colon_instead_of_comma.jsonn_array_comma_after_close.jsonn_array_comma_and_number.jsonn_array_double_comma.jsonn_array_double_extra_comma.jsonn_array_extra_close.jsonn_array_extra_comma.jsonn_array_incomplete.jsonn_array_incomplete_invalid_value.jsonn_array_inner_array_no_comma.jsonn_array_invalid_utf8.jsonn_array_items_separated_by_semicolon.jsonn_array_just_comma.jsonn_array_just_minus.jsonn_array_missing_value.jsonn_array_newlines_unclosed.jsonn_array_number_and_comma.jsonn_array_number_and_several_commas.jsonn_array_spaces_vertical_tab_formfeed.jsonn_array_star_inside.jsonn_array_unclosed.jsonn_array_unclosed_trailing_comma.jsonn_array_unclosed_with_new_lines.jsonn_array_unclosed_with_object_inside.jsonn_incomplete_false.jsonn_incomplete_null.jsonn_incomplete_true.jsonn_multidigit_number_then_00.jsonn_number_++.jsonn_number_+1.jsonn_number_+Inf.jsonn_number_-01.jsonn_number_-1.0..jsonn_number_-2..jsonn_number_-NaN.jsonn_number_.-1.jsonn_number_.2e-3.jsonn_number_0.1.2.jsonn_number_0.3e+.jsonn_number_0.3e.jsonn_number_0.e1.jsonn_number_0_capital_E+.jsonn_number_0_capital_E.jsonn_number_0e+.jsonn_number_0e.jsonn_number_1.0e+.jsonn_number_1.0e-.jsonn_number_1.0e.jsonn_number_1_000.jsonn_number_1eE2.jsonn_number_2.e+3.jsonn_number_2.e-3.jsonn_number_2.e3.jsonn_number_9.e+.jsonn_number_Inf.jsonn_number_NaN.jsonn_number_U+FF11_fullwidth_digit_one.jsonn_number_expression.jsonn_number_hex_1_digit.jsonn_number_hex_2_digits.jsonn_number_infinity.json
21
test/data/nst_json_testsuite2/LICENSE
Normal file
21
test/data/nst_json_testsuite2/LICENSE
Normal file
|
@ -0,0 +1,21 @@
|
|||
MIT License
|
||||
|
||||
Copyright (c) 2016 Nicolas Seriot
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
55
test/data/nst_json_testsuite2/README.md
Normal file
55
test/data/nst_json_testsuite2/README.md
Normal file
|
@ -0,0 +1,55 @@
|
|||
# JSON Parsing Test Suite
|
||||
A comprehensive test suite for RFC 8259 compliant JSON parsers
|
||||
|
||||
This repository was created as an appendix to the article [Parsing JSON is a Minefield 💣](http://seriot.ch/parsing_json.php).
|
||||
|
||||
**/parsers/**
|
||||
|
||||
This directory contains several parsers and tiny wrappers to turn the parsers into JSON validators, by returning a specific value.
|
||||
|
||||
- `0` the parser did accept the content
|
||||
- `1` the parser did reject the content
|
||||
- `>1` the process did crash
|
||||
- `timeout` happens after 5 seconds
|
||||
|
||||
**/test\_parsing/**
|
||||
|
||||
The name of these files tell if their contents should be accepted or rejected.
|
||||
|
||||
- `y_` content must be accepted by parsers
|
||||
- `n_` content must be rejected by parsers
|
||||
- `i_` parsers are free to accept or reject content
|
||||
|
||||
**/test\_transform/**
|
||||
|
||||
These files contain weird structures and characters that parsers may understand differently, eg:
|
||||
|
||||
- huge numbers
|
||||
- dictionaries with similar keys
|
||||
- NULL characters
|
||||
- escaped invalid strings
|
||||
|
||||
These files were used to produce `results/transform.html`.
|
||||
|
||||
**/run_tests.py**
|
||||
|
||||
Run all parsers with all files:
|
||||
|
||||
$ python3 run_tests.py
|
||||
|
||||
Run all parsers with a specific file:
|
||||
|
||||
$ python3 run_tests.py file.json
|
||||
|
||||
Run specific parsers with all files:
|
||||
|
||||
$ echo '["Python 2.7.10", "Python 3.5.2"]' > python_only.json
|
||||
$ python3 run_tests.py --filter=python_only.json
|
||||
|
||||
The script writes logs in `results/logs.txt`.
|
||||
|
||||
The script then reads `logs.txt` and generates `results/parsing.html`.
|
||||
|
||||
**/results/**
|
||||
|
||||
<img src="results/pruned_results.png" alt="JSON Parsing Tests" />
|
|
@ -0,0 +1 @@
|
|||
[123.456e-789]
|
|
@ -0,0 +1 @@
|
|||
[0.4e00669999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999969999999006]
|
|
@ -0,0 +1 @@
|
|||
[-1e+9999]
|
|
@ -0,0 +1 @@
|
|||
[1.5e+9999]
|
|
@ -0,0 +1 @@
|
|||
[-123123e100000]
|
|
@ -0,0 +1 @@
|
|||
[123123e100000]
|
|
@ -0,0 +1 @@
|
|||
[123e-10000000]
|
|
@ -0,0 +1 @@
|
|||
[-123123123123123123123123123123]
|
|
@ -0,0 +1 @@
|
|||
[100000000000000000000]
|
|
@ -0,0 +1 @@
|
|||
[-237462374673276894279832749832423479823246327846]
|
|
@ -0,0 +1 @@
|
|||
{"\uDFAA":0}
|
|
@ -0,0 +1 @@
|
|||
["\uDADA"]
|
|
@ -0,0 +1 @@
|
|||
["\uD888\u1234"]
|
Binary file not shown.
|
@ -0,0 +1 @@
|
|||
["譌・ム淫"]
|
|
@ -0,0 +1 @@
|
|||
["<22><><EFBFBD>"]
|
|
@ -0,0 +1 @@
|
|||
["\uD800\n"]
|
|
@ -0,0 +1 @@
|
|||
["\uDd1ea"]
|
|
@ -0,0 +1 @@
|
|||
["\uD800\uD800\n"]
|
|
@ -0,0 +1 @@
|
|||
["\ud800"]
|
|
@ -0,0 +1 @@
|
|||
["\ud800abc"]
|
|
@ -0,0 +1 @@
|
|||
["<22>"]
|
|
@ -0,0 +1 @@
|
|||
["\uDd1e\uD834"]
|
|
@ -0,0 +1 @@
|
|||
["И"]
|
|
@ -0,0 +1 @@
|
|||
["\uDFAA"]
|
|
@ -0,0 +1 @@
|
|||
["<22>"]
|
|
@ -0,0 +1 @@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]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]
|
|
@ -0,0 +1 @@
|
|||
{}
|
|
@ -0,0 +1 @@
|
|||
[1 true]
|
|
@ -0,0 +1 @@
|
|||
[a蘊
|
|
@ -0,0 +1 @@
|
|||
["": 1]
|
|
@ -0,0 +1 @@
|
|||
[""],
|
1
test/data/nst_json_testsuite2/test_parsing/n_array_comma_and_number.json
Executable file
1
test/data/nst_json_testsuite2/test_parsing/n_array_comma_and_number.json
Executable file
|
@ -0,0 +1 @@
|
|||
[,1]
|
1
test/data/nst_json_testsuite2/test_parsing/n_array_double_comma.json
Executable file
1
test/data/nst_json_testsuite2/test_parsing/n_array_double_comma.json
Executable file
|
@ -0,0 +1 @@
|
|||
[1,,2]
|
|
@ -0,0 +1 @@
|
|||
["x",,]
|
|
@ -0,0 +1 @@
|
|||
["x"]]
|
|
@ -0,0 +1 @@
|
|||
["",]
|
|
@ -0,0 +1 @@
|
|||
["x"
|
|
@ -0,0 +1 @@
|
|||
[x
|
|
@ -0,0 +1 @@
|
|||
[3[4]]
|
|
@ -0,0 +1 @@
|
|||
[<EFBFBD>]
|
|
@ -0,0 +1 @@
|
|||
[1:2]
|
1
test/data/nst_json_testsuite2/test_parsing/n_array_just_comma.json
Executable file
1
test/data/nst_json_testsuite2/test_parsing/n_array_just_comma.json
Executable file
|
@ -0,0 +1 @@
|
|||
[,]
|
1
test/data/nst_json_testsuite2/test_parsing/n_array_just_minus.json
Executable file
1
test/data/nst_json_testsuite2/test_parsing/n_array_just_minus.json
Executable file
|
@ -0,0 +1 @@
|
|||
[-]
|
|
@ -0,0 +1 @@
|
|||
[ , ""]
|
|
@ -0,0 +1,3 @@
|
|||
["a",
|
||||
4
|
||||
,1,
|
1
test/data/nst_json_testsuite2/test_parsing/n_array_number_and_comma.json
Executable file
1
test/data/nst_json_testsuite2/test_parsing/n_array_number_and_comma.json
Executable file
|
@ -0,0 +1 @@
|
|||
[1,]
|
|
@ -0,0 +1 @@
|
|||
[1,,]
|
|
@ -0,0 +1 @@
|
|||
["a"\f]
|
1
test/data/nst_json_testsuite2/test_parsing/n_array_star_inside.json
Executable file
1
test/data/nst_json_testsuite2/test_parsing/n_array_star_inside.json
Executable file
|
@ -0,0 +1 @@
|
|||
[*]
|
|
@ -0,0 +1 @@
|
|||
[""
|
|
@ -0,0 +1 @@
|
|||
[1,
|
|
@ -0,0 +1,3 @@
|
|||
[1,
|
||||
1
|
||||
,1
|
|
@ -0,0 +1 @@
|
|||
[{}
|
|
@ -0,0 +1 @@
|
|||
[fals]
|
|
@ -0,0 +1 @@
|
|||
[nul]
|
|
@ -0,0 +1 @@
|
|||
[tru]
|
Binary file not shown.
|
@ -0,0 +1 @@
|
|||
[++1234]
|
1
test/data/nst_json_testsuite2/test_parsing/n_number_+1.json
Executable file
1
test/data/nst_json_testsuite2/test_parsing/n_number_+1.json
Executable file
|
@ -0,0 +1 @@
|
|||
[+1]
|
1
test/data/nst_json_testsuite2/test_parsing/n_number_+Inf.json
Executable file
1
test/data/nst_json_testsuite2/test_parsing/n_number_+Inf.json
Executable file
|
@ -0,0 +1 @@
|
|||
[+Inf]
|
1
test/data/nst_json_testsuite2/test_parsing/n_number_-01.json
Executable file
1
test/data/nst_json_testsuite2/test_parsing/n_number_-01.json
Executable file
|
@ -0,0 +1 @@
|
|||
[-01]
|
1
test/data/nst_json_testsuite2/test_parsing/n_number_-1.0..json
Executable file
1
test/data/nst_json_testsuite2/test_parsing/n_number_-1.0..json
Executable file
|
@ -0,0 +1 @@
|
|||
[-1.0.]
|
1
test/data/nst_json_testsuite2/test_parsing/n_number_-2..json
Executable file
1
test/data/nst_json_testsuite2/test_parsing/n_number_-2..json
Executable file
|
@ -0,0 +1 @@
|
|||
[-2.]
|
1
test/data/nst_json_testsuite2/test_parsing/n_number_-NaN.json
Executable file
1
test/data/nst_json_testsuite2/test_parsing/n_number_-NaN.json
Executable file
|
@ -0,0 +1 @@
|
|||
[-NaN]
|
|
@ -0,0 +1 @@
|
|||
[.-1]
|
1
test/data/nst_json_testsuite2/test_parsing/n_number_.2e-3.json
Executable file
1
test/data/nst_json_testsuite2/test_parsing/n_number_.2e-3.json
Executable file
|
@ -0,0 +1 @@
|
|||
[.2e-3]
|
1
test/data/nst_json_testsuite2/test_parsing/n_number_0.1.2.json
Executable file
1
test/data/nst_json_testsuite2/test_parsing/n_number_0.1.2.json
Executable file
|
@ -0,0 +1 @@
|
|||
[0.1.2]
|
|
@ -0,0 +1 @@
|
|||
[0.3e+]
|
|
@ -0,0 +1 @@
|
|||
[0.3e]
|
|
@ -0,0 +1 @@
|
|||
[0.e1]
|
|
@ -0,0 +1 @@
|
|||
[0E+]
|
1
test/data/nst_json_testsuite2/test_parsing/n_number_0_capital_E.json
Executable file
1
test/data/nst_json_testsuite2/test_parsing/n_number_0_capital_E.json
Executable file
|
@ -0,0 +1 @@
|
|||
[0E]
|
|
@ -0,0 +1 @@
|
|||
[0e+]
|
|
@ -0,0 +1 @@
|
|||
[0e]
|
1
test/data/nst_json_testsuite2/test_parsing/n_number_1.0e+.json
Executable file
1
test/data/nst_json_testsuite2/test_parsing/n_number_1.0e+.json
Executable file
|
@ -0,0 +1 @@
|
|||
[1.0e+]
|
1
test/data/nst_json_testsuite2/test_parsing/n_number_1.0e-.json
Executable file
1
test/data/nst_json_testsuite2/test_parsing/n_number_1.0e-.json
Executable file
|
@ -0,0 +1 @@
|
|||
[1.0e-]
|
1
test/data/nst_json_testsuite2/test_parsing/n_number_1.0e.json
Executable file
1
test/data/nst_json_testsuite2/test_parsing/n_number_1.0e.json
Executable file
|
@ -0,0 +1 @@
|
|||
[1.0e]
|
1
test/data/nst_json_testsuite2/test_parsing/n_number_1_000.json
Executable file
1
test/data/nst_json_testsuite2/test_parsing/n_number_1_000.json
Executable file
|
@ -0,0 +1 @@
|
|||
[1 000.0]
|
1
test/data/nst_json_testsuite2/test_parsing/n_number_1eE2.json
Executable file
1
test/data/nst_json_testsuite2/test_parsing/n_number_1eE2.json
Executable file
|
@ -0,0 +1 @@
|
|||
[1eE2]
|
1
test/data/nst_json_testsuite2/test_parsing/n_number_2.e+3.json
Executable file
1
test/data/nst_json_testsuite2/test_parsing/n_number_2.e+3.json
Executable file
|
@ -0,0 +1 @@
|
|||
[2.e+3]
|
1
test/data/nst_json_testsuite2/test_parsing/n_number_2.e-3.json
Executable file
1
test/data/nst_json_testsuite2/test_parsing/n_number_2.e-3.json
Executable file
|
@ -0,0 +1 @@
|
|||
[2.e-3]
|
1
test/data/nst_json_testsuite2/test_parsing/n_number_2.e3.json
Executable file
1
test/data/nst_json_testsuite2/test_parsing/n_number_2.e3.json
Executable file
|
@ -0,0 +1 @@
|
|||
[2.e3]
|
|
@ -0,0 +1 @@
|
|||
[9.e+]
|
1
test/data/nst_json_testsuite2/test_parsing/n_number_Inf.json
Executable file
1
test/data/nst_json_testsuite2/test_parsing/n_number_Inf.json
Executable file
|
@ -0,0 +1 @@
|
|||
[Inf]
|
1
test/data/nst_json_testsuite2/test_parsing/n_number_NaN.json
Executable file
1
test/data/nst_json_testsuite2/test_parsing/n_number_NaN.json
Executable file
|
@ -0,0 +1 @@
|
|||
[NaN]
|
|
@ -0,0 +1 @@
|
|||
[1]
|
|
@ -0,0 +1 @@
|
|||
[1+2]
|
|
@ -0,0 +1 @@
|
|||
[0x1]
|
|
@ -0,0 +1 @@
|
|||
[0x42]
|
1
test/data/nst_json_testsuite2/test_parsing/n_number_infinity.json
Executable file
1
test/data/nst_json_testsuite2/test_parsing/n_number_infinity.json
Executable file
|
@ -0,0 +1 @@
|
|||
[Infinity]
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue