You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The JSONTestSuite defines these tests as class "i" which means that parsers may choose to reject them as invalid. As it stands JSON.jl throws an error for these tests, which is an acceptable result. However, it might be better to support these inputs.
using JSON
using LazyJSON
using Test
for (name, jparse) in [("LazyJSON", x->LazyJSON.value(x; lazy=false)), ("JSON", x->JSON.parse(x))]
@testset"$name"begin# See https://github.com/nst/JSONTestSuite@testjparse("[123.456e-789]") == Any[BigFloat("1.23456e-787")] # i_number_double_huge_neg_exp.json@testjparse("[0.4e00669999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999969999999006]") == Any[Inf] # i_number_huge_exp.json@testjparse("[-1e+9999]") == Any[BigFloat("-1.0e+9999")]
@testjparse("[1.5e+9999]") == Any[BigFloat("1.5e+9999")]
@testjparse("[-123123e100000]") == Any[BigFloat("-123123e100000")]
@testjparse("[123123e100000]") == Any[BigFloat("123123e100000")]
@testjparse("[123e-10000000]") == Any[BigFloat("123e-10000000")]
@testjparse("{\"\\uDFAA\":0}") ==Dict("\udfaa"=>0) # i_object_key_lone_2nd_surrogate.json@testjparse("[\"\\uDADA\"]") == Any["\udada"] # i_string_1st_surrogate_but_2nd_missing.json@testjparse("[\"\\uD800\\n\"]") == Any["\ud800\n"] # i_string_incomplete_surrogate_and_escape_valid.json@testjparse("[\"\\uDd1ea\"]") == Any["\udd1ea"] # i_string_incomplete_surrogate_pair.json@testjparse("[\"\\ud800\"]") == Any["\ud800"] # i_string_invalid_lonely_surrogate.json@testjparse("[\"\\ud800abc\"]") == Any["\ud800abc"] # i_string_invalid_surrogate.json@testjparse("[\"\\uDFAA\"]") == Any["\udfaa"] # i_string_lone_second_surrogate.jsonendend
Test Summary:| Pass Total
LazyJSON |1414
Test Summary:| Error Total
JSON |1414
The text was updated successfully, but these errors were encountered:
I've modified the LazyJSON tests so that they also apply the NST JSONTestSuite to JSON.jl and JSON2.jl: https://github.com/samoconnor/LazyJSON.jl/blob/master/test/runtests.jl#L360-L362
The JSONTestSuite defines these tests as class "i" which means that parsers may choose to reject them as invalid. As it stands JSON.jl throws an error for these tests, which is an acceptable result. However, it might be better to support these inputs.
The text was updated successfully, but these errors were encountered: