JSON Parsing Tests, Full

Appendix to: seriot.ch Parsing JSON is a Minefield http://www.seriot.ch/parsing_json.php

2016-11-19 15:08:57

Contents

  1. Color Scheme
  2. Full Results
  3. Results by Parser

1. Color scheme:

expected result
parsing should have succeeded but failed
parsing should have failed but succeeded
result undefined, parsing succeeded
result undefined, parsing failed
parser crashed
timeout

2. Full Results

Free Pascal fcl-json
Xidel Internet Tools
Xidel Internet Tools (liberal, non-strict parsing mode)
n_structure_100000_opening_arrays.json [[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[(...)
n_structure_open_array_object.json [{"":[{"":[{"":[{"":[{"":[{"":[{"":[(...)
i_string_UTF-16LE_with_BOM.json FFFE[00"00E900"00]00 <=> [""]
i_string_utf16LE_no_BOM.json [00"00E900"00]00 <=> [""]
i_structure_UTF-8_BOM_empty_object.json EFBBBF{} <=> {}
i_number_double_huge_neg_exp.json [123.456e-789]
i_number_huge_exp.json [0.4e0066999999999999999999999999999(...)
i_number_neg_int_huge_exp.json [-1e+9999]
i_number_pos_double_huge_exp.json [1.5e+9999]
i_number_real_neg_overflow.json [-123123e100000]
i_number_real_pos_overflow.json [123123e100000]
i_number_real_underflow.json [123e-10000000]
i_number_too_big_neg_int.json [-123123123123123123123123123123]
i_number_too_big_pos_int.json [100000000000000000000]
i_number_very_big_negative_int.json [-2374623746732768942798327498324234(...)
i_object_key_lone_2nd_surrogate.json {"\uDFAA":0}
i_string_1st_surrogate_but_2nd_missing.json ["\uDADA"]
i_string_1st_valid_surrogate_2nd_invalid.json ["\uD888\u1234"]
i_string_UTF-8_invalid_sequence.json ["E697A5D188FA"] <=> ["日ш"]
i_string_UTF8_surrogate_U+D800.json ["EDA080"] <=> [""]
i_string_incomplete_surrogate_and_escape_valid.json ["\uD800\n"]
i_string_incomplete_surrogate_pair.json ["\uDd1ea"]
i_string_incomplete_surrogates_escape_valid.json ["\uD800\uD800\n"]
i_string_invalid_lonely_surrogate.json ["\ud800"]
i_string_invalid_surrogate.json ["\ud800abc"]
i_string_invalid_utf-8.json ["FF"] <=> [""]
i_string_inverted_surrogates_U+1D11E.json ["\uDd1e\uD834"]
i_string_iso_latin_1.json ["E9"] <=> [""]
i_string_lone_second_surrogate.json ["\uDFAA"]
i_string_lone_utf8_continuation_byte.json ["81"] <=> [""]
i_string_not_in_unicode_range.json ["F4BFBFBF"] <=> [""]
i_string_overlong_sequence_2_bytes.json ["C0AF"] <=> [""]
i_string_overlong_sequence_6_bytes.json ["FC83BFBFBFBF"] <=> [""]
i_string_overlong_sequence_6_bytes_null.json ["FC8080808080"] <=> [""]
i_string_truncated-utf-8.json ["E0FF"] <=> [""]
i_string_utf16BE_no_BOM.json 00[00"00E900"00] <=> [""]
i_structure_500_nested_arrays.json [[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[(...)
n_array_comma_after_close.json [""],
n_array_extra_close.json ["x"]]
n_object_trailing_comment.json {"a":"b"}/**/
n_object_trailing_comment_open.json {"a":"b"}/**//
n_object_trailing_comment_slash_open.json {"a":"b"}//
n_object_trailing_comment_slash_open_incomplete.json {"a":"b"}/
n_object_with_trailing_garbage.json {"a":"b"}#
n_string_with_trailing_garbage.json ""x
n_structure_array_trailing_garbage.json [1]x
n_structure_array_with_extra_array_close.json [1]]
n_structure_close_unopened_array.json 1]
n_structure_number_with_trailing_garbage.json 2@
n_structure_object_followed_by_closing_object.json {}}
n_structure_trailing_#.json {"a":"b"}#{}
n_object_key_with_single_quotes.json {key: 'value'}
n_object_unquoted_key.json {a: "b"}
n_structure_double_array.json [][]
n_structure_object_with_trailing_garbage.json {"a": true} "x"
n_multidigit_number_then_00.json 12300 <=> 123
n_number_-01.json [-01]
n_number_.2e-3.json [.2e-3]
n_number_0.3e+.json [0.3e+]
n_number_0.e1.json [0.e1]
n_number_0_capital_E+.json [0E+]
n_number_0e+.json [0e+]
n_number_1.0e+.json [1.0e+]
n_number_1.0e-.json [1.0e-]
n_number_2.e+3.json [2.e+3]
n_number_2.e-3.json [2.e-3]
n_number_2.e3.json [2.e3]
n_number_9.e+.json [9.e+]
n_number_neg_int_starting_with_zero.json [-012]
n_number_neg_real_without_int_part.json [-.123]
n_number_starting_with_dot.json [.123]
n_number_with_leading_zero.json [012]
n_object_single_quote.json {'a':0}
n_single_space.json
n_string_single_quote.json ['single quote']
n_string_unescaped_tab.json ["09"] <=> [" "]
n_structure_capitalized_True.json [True]
n_structure_no_data.json
n_array_extra_comma.json ["",]
n_array_number_and_comma.json [1,]
n_number_Inf.json [Inf]
n_number_NaN.json [NaN]
n_number_infinity.json [Infinity]
n_number_minus_infinity.json [-Infinity]
n_object_pi_in_key_and_trailing_comma.json {"B9":"0",} <=> {"":"0",}
n_object_trailing_comma.json {"id":0,}
n_number_0_capital_E.json [0E]
n_number_0e.json [0e]

3. Results by Parser

Bash JSON.sh 2016-08-12

C JSON Checker

C JSON Checker 2

C JSON Parser by udp

C JSON-C

C cJSON

C ccan

C jansson

C jsmn

Crystal

Elixir ExJSON

Elixir Json

Elixir Poison

Free Pascal fcl-json

i_number_double_huge_neg_exp.json [123.456e-789]
i_number_huge_exp.json [0.4e0066999999999999999999999999999(...)
i_number_neg_int_huge_exp.json [-1e+9999]
i_number_pos_double_huge_exp.json [1.5e+9999]
i_number_real_neg_overflow.json [-123123e100000]
i_number_real_pos_overflow.json [123123e100000]
i_number_real_underflow.json [123e-10000000]
i_number_too_big_neg_int.json [-123123123123123123123123123123]
i_number_too_big_pos_int.json [100000000000000000000]
i_number_very_big_negative_int.json [-2374623746732768942798327498324234(...)
i_object_key_lone_2nd_surrogate.json {"\uDFAA":0}
i_string_1st_surrogate_but_2nd_missing.json ["\uDADA"]
i_string_1st_valid_surrogate_2nd_invalid.json ["\uD888\u1234"]
i_string_UTF-16LE_with_BOM.json FFFE[00"00E900"00]00 <=> [""]
i_string_UTF-8_invalid_sequence.json ["E697A5D188FA"] <=> ["日ш"]
i_string_UTF8_surrogate_U+D800.json ["EDA080"] <=> [""]
i_string_incomplete_surrogate_and_escape_valid.json ["\uD800\n"]
i_string_incomplete_surrogate_pair.json ["\uDd1ea"]
i_string_incomplete_surrogates_escape_valid.json ["\uD800\uD800\n"]
i_string_invalid_lonely_surrogate.json ["\ud800"]
i_string_invalid_surrogate.json ["\ud800abc"]
i_string_invalid_utf-8.json ["FF"] <=> [""]
i_string_inverted_surrogates_U+1D11E.json ["\uDd1e\uD834"]
i_string_iso_latin_1.json ["E9"] <=> [""]
i_string_lone_second_surrogate.json ["\uDFAA"]
i_string_lone_utf8_continuation_byte.json ["81"] <=> [""]
i_string_not_in_unicode_range.json ["F4BFBFBF"] <=> [""]
i_string_overlong_sequence_2_bytes.json ["C0AF"] <=> [""]
i_string_overlong_sequence_6_bytes.json ["FC83BFBFBFBF"] <=> [""]
i_string_overlong_sequence_6_bytes_null.json ["FC8080808080"] <=> [""]
i_string_truncated-utf-8.json ["E0FF"] <=> [""]
i_string_utf16BE_no_BOM.json 00[00"00E900"00] <=> [""]
i_string_utf16LE_no_BOM.json [00"00E900"00]00 <=> [""]
i_structure_500_nested_arrays.json [[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[(...)
i_structure_UTF-8_BOM_empty_object.json EFBBBF{} <=> {}
n_array_comma_after_close.json [""],
n_array_extra_close.json ["x"]]
n_multidigit_number_then_00.json 12300 <=> 123
n_number_-01.json [-01]
n_number_.2e-3.json [.2e-3]
n_number_0.3e+.json [0.3e+]
n_number_0.e1.json [0.e1]
n_number_0_capital_E+.json [0E+]
n_number_0e+.json [0e+]
n_number_1.0e+.json [1.0e+]
n_number_1.0e-.json [1.0e-]
n_number_2.e+3.json [2.e+3]
n_number_2.e-3.json [2.e-3]
n_number_2.e3.json [2.e3]
n_number_9.e+.json [9.e+]
n_number_neg_int_starting_with_zero.json [-012]
n_number_neg_real_without_int_part.json [-.123]
n_number_starting_with_dot.json [.123]
n_number_with_leading_zero.json [012]
n_object_key_with_single_quotes.json {key: 'value'}
n_object_single_quote.json {'a':0}
n_object_trailing_comment.json {"a":"b"}/**/
n_object_trailing_comment_open.json {"a":"b"}/**//
n_object_trailing_comment_slash_open.json {"a":"b"}//
n_object_trailing_comment_slash_open_incomplete.json {"a":"b"}/
n_object_unquoted_key.json {a: "b"}
n_object_with_trailing_garbage.json {"a":"b"}#
n_single_space.json
n_string_single_quote.json ['single quote']
n_string_unescaped_tab.json ["09"] <=> [" "]
n_string_with_trailing_garbage.json ""x
n_structure_100000_opening_arrays.json [[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[(...)
n_structure_array_trailing_garbage.json [1]x
n_structure_array_with_extra_array_close.json [1]]
n_structure_capitalized_True.json [True]
n_structure_close_unopened_array.json 1]
n_structure_double_array.json [][]
n_structure_no_data.json
n_structure_number_with_trailing_garbage.json 2@
n_structure_object_followed_by_closing_object.json {}}
n_structure_object_with_trailing_garbage.json {"a": true} "x"
n_structure_open_array_object.json [{"":[{"":[{"":[{"":[{"":[{"":[{"":[(...)
n_structure_trailing_#.json {"a":"b"}#{}

Go 1.7.1

Haskell Aeson 0.11.2.1

Java Actson 1.2.0

Java Jackson 2.8.4

Java com.leastfixedpoint.json 1.0

Java gson 2.7

Java json-simple 1.1.1

Java nanojson 1.0

Java nanojson 1.1

Java org.json 2016-08-15

JavaScript

Json.NET 9.0.1

Lua JSON 20160916.19

Lua dkjson

Nim

OCaml Yojson

Obj-C Apple NSJSONSerialization

Obj-C JSONKit

Obj-C SBJSON 4.0.3

Obj-C SBJSON 4.0.4

Obj-C TouchJSON

PHP 5.5.36

Perl Cpanel::JSON::XS

Perl JSON

Perl JSON::PP

Perl JSON::XS

Python 2.7.10

Python 3.5.2

Python simplejson 3.10

Python ujson 1.35

Qt JSON

R jsonlite

R rjson

Ruby

Ruby Oj (compat mode)

Ruby Oj (strict mode)

Ruby Yajl

Ruby regex

Rust json-rust

Rust rustc_serialize::json

Rust serde_json

Squeak JSON-tonyg

Swift Apple JSONSerialization

Swift Freddy 2.1.0

Swift Freddy 20160830

Swift Freddy 20161018

Swift PMJSON 1.1.0

Swift PMJSON 1.2.0

Swift PMJSON 1.2.1

Swift STJSON

Xidel Internet Tools

i_number_double_huge_neg_exp.json [123.456e-789]
i_number_huge_exp.json [0.4e0066999999999999999999999999999(...)
i_number_neg_int_huge_exp.json [-1e+9999]
i_number_pos_double_huge_exp.json [1.5e+9999]
i_number_real_neg_overflow.json [-123123e100000]
i_number_real_pos_overflow.json [123123e100000]
i_number_real_underflow.json [123e-10000000]
i_number_too_big_neg_int.json [-123123123123123123123123123123]
i_number_too_big_pos_int.json [100000000000000000000]
i_number_very_big_negative_int.json [-2374623746732768942798327498324234(...)
i_object_key_lone_2nd_surrogate.json {"\uDFAA":0}
i_string_1st_surrogate_but_2nd_missing.json ["\uDADA"]
i_string_1st_valid_surrogate_2nd_invalid.json ["\uD888\u1234"]
i_string_UTF-16LE_with_BOM.json FFFE[00"00E900"00]00 <=> [""]
i_string_UTF-8_invalid_sequence.json ["E697A5D188FA"] <=> ["日ш"]
i_string_UTF8_surrogate_U+D800.json ["EDA080"] <=> [""]
i_string_incomplete_surrogate_and_escape_valid.json ["\uD800\n"]
i_string_incomplete_surrogate_pair.json ["\uDd1ea"]
i_string_incomplete_surrogates_escape_valid.json ["\uD800\uD800\n"]
i_string_invalid_lonely_surrogate.json ["\ud800"]
i_string_invalid_surrogate.json ["\ud800abc"]
i_string_invalid_utf-8.json ["FF"] <=> [""]
i_string_inverted_surrogates_U+1D11E.json ["\uDd1e\uD834"]
i_string_iso_latin_1.json ["E9"] <=> [""]
i_string_lone_second_surrogate.json ["\uDFAA"]
i_string_lone_utf8_continuation_byte.json ["81"] <=> [""]
i_string_not_in_unicode_range.json ["F4BFBFBF"] <=> [""]
i_string_overlong_sequence_2_bytes.json ["C0AF"] <=> [""]
i_string_overlong_sequence_6_bytes.json ["FC83BFBFBFBF"] <=> [""]
i_string_overlong_sequence_6_bytes_null.json ["FC8080808080"] <=> [""]
i_string_truncated-utf-8.json ["E0FF"] <=> [""]
i_string_utf16BE_no_BOM.json 00[00"00E900"00] <=> [""]
i_string_utf16LE_no_BOM.json [00"00E900"00]00 <=> [""]
i_structure_500_nested_arrays.json [[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[(...)
i_structure_UTF-8_BOM_empty_object.json EFBBBF{} <=> {}
n_multidigit_number_then_00.json 12300 <=> 123
n_number_-01.json [-01]
n_number_.2e-3.json [.2e-3]
n_number_0.3e+.json [0.3e+]
n_number_0.e1.json [0.e1]
n_number_0_capital_E+.json [0E+]
n_number_0_capital_E.json [0E]
n_number_0e+.json [0e+]
n_number_0e.json [0e]
n_number_1.0e+.json [1.0e+]
n_number_1.0e-.json [1.0e-]
n_number_2.e+3.json [2.e+3]
n_number_2.e-3.json [2.e-3]
n_number_2.e3.json [2.e3]
n_number_9.e+.json [9.e+]
n_number_neg_int_starting_with_zero.json [-012]
n_number_neg_real_without_int_part.json [-.123]
n_number_starting_with_dot.json [.123]
n_number_with_leading_zero.json [012]
n_object_single_quote.json {'a':0}
n_single_space.json
n_string_single_quote.json ['single quote']
n_string_unescaped_tab.json ["09"] <=> [" "]
n_structure_capitalized_True.json [True]
n_structure_no_data.json

Xidel Internet Tools (liberal, non-strict parsing mode)

i_number_double_huge_neg_exp.json [123.456e-789]
i_number_huge_exp.json [0.4e0066999999999999999999999999999(...)
i_number_neg_int_huge_exp.json [-1e+9999]
i_number_pos_double_huge_exp.json [1.5e+9999]
i_number_real_neg_overflow.json [-123123e100000]
i_number_real_pos_overflow.json [123123e100000]
i_number_real_underflow.json [123e-10000000]
i_number_too_big_neg_int.json [-123123123123123123123123123123]
i_number_too_big_pos_int.json [100000000000000000000]
i_number_very_big_negative_int.json [-2374623746732768942798327498324234(...)
i_object_key_lone_2nd_surrogate.json {"\uDFAA":0}
i_string_1st_surrogate_but_2nd_missing.json ["\uDADA"]
i_string_1st_valid_surrogate_2nd_invalid.json ["\uD888\u1234"]
i_string_UTF-16LE_with_BOM.json FFFE[00"00E900"00]00 <=> [""]
i_string_UTF-8_invalid_sequence.json ["E697A5D188FA"] <=> ["日ш"]
i_string_UTF8_surrogate_U+D800.json ["EDA080"] <=> [""]
i_string_incomplete_surrogate_and_escape_valid.json ["\uD800\n"]
i_string_incomplete_surrogate_pair.json ["\uDd1ea"]
i_string_incomplete_surrogates_escape_valid.json ["\uD800\uD800\n"]
i_string_invalid_lonely_surrogate.json ["\ud800"]
i_string_invalid_surrogate.json ["\ud800abc"]
i_string_invalid_utf-8.json ["FF"] <=> [""]
i_string_inverted_surrogates_U+1D11E.json ["\uDd1e\uD834"]
i_string_iso_latin_1.json ["E9"] <=> [""]
i_string_lone_second_surrogate.json ["\uDFAA"]
i_string_lone_utf8_continuation_byte.json ["81"] <=> [""]
i_string_not_in_unicode_range.json ["F4BFBFBF"] <=> [""]
i_string_overlong_sequence_2_bytes.json ["C0AF"] <=> [""]
i_string_overlong_sequence_6_bytes.json ["FC83BFBFBFBF"] <=> [""]
i_string_overlong_sequence_6_bytes_null.json ["FC8080808080"] <=> [""]
i_string_truncated-utf-8.json ["E0FF"] <=> [""]
i_string_utf16BE_no_BOM.json 00[00"00E900"00] <=> [""]
i_string_utf16LE_no_BOM.json [00"00E900"00]00 <=> [""]
i_structure_500_nested_arrays.json [[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[(...)
i_structure_UTF-8_BOM_empty_object.json EFBBBF{} <=> {}
n_array_extra_comma.json ["",]
n_array_number_and_comma.json [1,]
n_multidigit_number_then_00.json 12300 <=> 123
n_number_-01.json [-01]
n_number_.2e-3.json [.2e-3]
n_number_0.3e+.json [0.3e+]
n_number_0.e1.json [0.e1]
n_number_0_capital_E+.json [0E+]
n_number_0_capital_E.json [0E]
n_number_0e+.json [0e+]
n_number_0e.json [0e]
n_number_1.0e+.json [1.0e+]
n_number_1.0e-.json [1.0e-]
n_number_2.e+3.json [2.e+3]
n_number_2.e-3.json [2.e-3]
n_number_2.e3.json [2.e3]
n_number_9.e+.json [9.e+]
n_number_Inf.json [Inf]
n_number_NaN.json [NaN]
n_number_infinity.json [Infinity]
n_number_minus_infinity.json [-Infinity]
n_number_neg_int_starting_with_zero.json [-012]
n_number_neg_real_without_int_part.json [-.123]
n_number_starting_with_dot.json [.123]
n_number_with_leading_zero.json [012]
n_object_key_with_single_quotes.json {key: 'value'}
n_object_pi_in_key_and_trailing_comma.json {"B9":"0",} <=> {"":"0",}
n_object_single_quote.json {'a':0}
n_object_trailing_comma.json {"id":0,}
n_object_unquoted_key.json {a: "b"}
n_single_space.json
n_string_single_quote.json ['single quote']
n_string_unescaped_tab.json ["09"] <=> [" "]
n_structure_capitalized_True.json [True]
n_structure_double_array.json [][]
n_structure_no_data.json
n_structure_object_with_trailing_garbage.json {"a": true} "x"