nst / JSONTestSuite

A comprehensive test suite for RFC 8259 compliant JSON parsers
MIT License
952 stars 148 forks source link

Add category of tests for JSON extensions? #93

Open nicowilliams opened 5 years ago

nicowilliams commented 5 years ago

The RFC permits extensions. For example, jq accepts some representations of infinity, and is a bit liberal about number representations. A number of n_* tests could be labeled as "failure might be due to the parser supporting extensions".

From RFC7159:

  1. Parsers

    A JSON parser transforms a JSON text into another representation. A JSON parser MUST accept all texts that conform to the JSON grammar. A JSON parser MAY accept non-JSON forms or extensions.

nicowilliams commented 5 years ago

E.g.,

test_parsing/n_number_+Inf.json:[+Inf]
test_parsing/n_number_-NaN.json:[-NaN]
test_parsing/n_number_Inf.json:[Inf]
test_parsing/n_number_NaN.json:[NaN]
test_parsing/n_number_infinity.json:[Infinity]
test_parsing/n_number_minus_infinity.json:[-Infinity]