We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
JRuby master running updated Ruby 2.3 tests.
The following test was added to MRI's json tests at some point:
def test_parse_json_primitive_values assert_raise(JSON::ParserError) { JSON.parse('') } assert_raise(JSON::ParserError) { JSON.parse('', :quirks_mode => true) } assert_raise(TypeError) { JSON::Parser.new(nil).parse } assert_raise(TypeError) { JSON::Parser.new(nil, :quirks_mode => true).parse } assert_raise(TypeError) { JSON.parse(nil) } assert_raise(TypeError) { JSON.parse(nil, :quirks_mode => true) } assert_raise(JSON::ParserError) { JSON.parse(' /* foo */ ') } assert_raise(JSON::ParserError) { JSON.parse(' /* foo */ ', :quirks_mode => true) } parser = JSON::Parser.new('null') assert_equal false, parser.quirks_mode? assert_raise(JSON::ParserError) { parser.parse } assert_raise(JSON::ParserError) { JSON.parse('null') } assert_equal nil, JSON.parse('null', :quirks_mode => true) parser = JSON::Parser.new('null', :quirks_mode => true) assert_equal true, parser.quirks_mode? assert_equal nil, parser.parse assert_raise(JSON::ParserError) { JSON.parse('false') } assert_equal false, JSON.parse('false', :quirks_mode => true) assert_raise(JSON::ParserError) { JSON.parse('true') } assert_equal true, JSON.parse('true', :quirks_mode => true) assert_raise(JSON::ParserError) { JSON.parse('23') } assert_equal 23, JSON.parse('23', :quirks_mode => true) assert_raise(JSON::ParserError) { JSON.parse('1') } assert_equal 1, JSON.parse('1', :quirks_mode => true) assert_raise(JSON::ParserError) { JSON.parse('3.141') } assert_in_delta 3.141, JSON.parse('3.141', :quirks_mode => true), 1E-3 assert_raise(JSON::ParserError) { JSON.parse('18446744073709551616') } assert_equal 2 ** 64, JSON.parse('18446744073709551616', :quirks_mode => true) assert_raise(JSON::ParserError) { JSON.parse('"foo"') } assert_equal 'foo', JSON.parse('"foo"', :quirks_mode => true) assert_raise(JSON::ParserError) { JSON.parse('NaN', :allow_nan => true) } assert JSON.parse('NaN', :quirks_mode => true, :allow_nan => true).nan? assert_raise(JSON::ParserError) { JSON.parse('Infinity', :allow_nan => true) } assert JSON.parse('Infinity', :quirks_mode => true, :allow_nan => true).infinite? assert_raise(JSON::ParserError) { JSON.parse('-Infinity', :allow_nan => true) } assert JSON.parse('-Infinity', :quirks_mode => true, :allow_nan => true).infinite? assert_raise(JSON::ParserError) { JSON.parse('[ 1, ]', :quirks_mode => true) } end
The test fails because we do not expose a quirks_mode? accessor in our json.
quirks_mode?
The text was updated successfully, but these errors were encountered:
Copy @flori since he still maintains the json library.
Sorry, something went wrong.
Quirks mode no longer appears to exist in json or its tests.
flori/json@7d2ad6d
No branches or pull requests
Environment
JRuby master running updated Ruby 2.3 tests.
Expected Behavior
The following test was added to MRI's json tests at some point:
Actual Behavior
The test fails because we do not expose a
quirks_mode?
accessor in our json.The text was updated successfully, but these errors were encountered: