diff options
author | Florian Frank <flori@ping.de> | 2016-06-02 21:10:36 +0200 |
---|---|---|
committer | Florian Frank <flori@ping.de> | 2016-06-02 21:11:23 +0200 |
commit | 7d2ad6d6556da03300a5aeadeeacaec563435773 (patch) | |
tree | bdf346367cb20685f8001fc2091e00b6a84a22fe /tests | |
parent | a985a0c4b074280e2a9e215ead95b1e66797b6c3 (diff) | |
download | json-7d2ad6d6556da03300a5aeadeeacaec563435773.tar.gz |
Remove quirks mode
Diffstat (limited to 'tests')
-rw-r--r-- | tests/json_common_interface_test.rb | 7 | ||||
-rw-r--r-- | tests/json_generator_test.rb | 3 | ||||
-rw-r--r-- | tests/json_parser_test.rb | 2 | ||||
-rw-r--r-- | tests/test_helper.rb | 4 |
4 files changed, 7 insertions, 9 deletions
diff --git a/tests/json_common_interface_test.rb b/tests/json_common_interface_test.rb index 6485328..382c77b 100644 --- a/tests/json_common_interface_test.rb +++ b/tests/json_common_interface_test.rb @@ -70,6 +70,12 @@ class JSONCommonInterfaceTest < Test::Unit::TestCase assert JSON.load(json, nil, :allow_nan => true)['foo'].nan? end + def test_load_null + assert_equal nil, JSON.load(nil, nil, :allow_null => true) + assert_raises(TypeError) { JSON.load(nil, nil, :allow_null => false) } + assert_raises(JSON::ParserError) { JSON.load('', nil, :allow_null => false) } + end + def test_dump too_deep = '[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]' assert_equal too_deep, dump(eval(too_deep)) @@ -92,7 +98,6 @@ class JSONCommonInterfaceTest < Test::Unit::TestCase assert_equal max_nesting, JSON.dump_default_options[:max_nesting] end - def test_JSON end end diff --git a/tests/json_generator_test.rb b/tests/json_generator_test.rb index 2bb7e15..75e19d9 100644 --- a/tests/json_generator_test.rb +++ b/tests/json_generator_test.rb @@ -135,7 +135,6 @@ EOT :array_nl => "\n", :ascii_only => false, :buffer_initial_length => 1024, - :quirks_mode => false, :depth => 0, :indent => " ", :max_nesting => 100, @@ -152,7 +151,6 @@ EOT :array_nl => "", :ascii_only => false, :buffer_initial_length => 1024, - :quirks_mode => false, :depth => 0, :indent => "", :max_nesting => 100, @@ -169,7 +167,6 @@ EOT :array_nl => "", :ascii_only => false, :buffer_initial_length => 1024, - :quirks_mode => false, :depth => 0, :indent => "", :max_nesting => 0, diff --git a/tests/json_parser_test.rb b/tests/json_parser_test.rb index 1123aab..a5793f9 100644 --- a/tests/json_parser_test.rb +++ b/tests/json_parser_test.rb @@ -137,7 +137,7 @@ class JSONParserTest < Test::Unit::TestCase assert parse('NaN', :allow_nan => true).nan? assert parse('Infinity', :allow_nan => true).infinite? assert parse('-Infinity', :allow_nan => true).infinite? - assert_raise(JSON::ParserError) { parse('[ 1, ]', :quirks_mode => true) } + assert_raise(JSON::ParserError) { parse('[ 1, ]') } end def test_parse_some_strings diff --git a/tests/test_helper.rb b/tests/test_helper.rb index 9d3665d..752f5f5 100644 --- a/tests/test_helper.rb +++ b/tests/test_helper.rb @@ -17,7 +17,3 @@ begin require 'byebug' rescue LoadError end -if ENV['START_SIMPLECOV'].to_i == 1 - require 'simplecov' - SimpleCov.start -end |