diff options
author | Florian Frank <flori@ping.de> | 2011-07-31 01:00:36 +0200 |
---|---|---|
committer | Florian Frank <flori@ping.de> | 2011-07-31 01:57:19 +0200 |
commit | 86bd839402eae91a1703fdfe6e1ae8267f39f030 (patch) | |
tree | 0f20c9c4fb7e0c242308c1920ea483ac09e99e1b /tests | |
parent | 42db6f6ad04057f6d6cbbfd68652b71815c8fe47 (diff) | |
parent | 9d0b1ca629f6f5bc558a4b3f887f0f8cf154fe78 (diff) | |
download | json-86bd839402eae91a1703fdfe6e1ae8267f39f030.tar.gz |
Merge branch 'quirks-mode-parser' into quirks-mode
Conflicts:
java/src/json/ext/Parser.java
java/src/json/ext/Parser.rl
json.gemspec
json_pure.gemspec
tests/test_json.rb
Diffstat (limited to 'tests')
-rwxr-xr-x | tests/test_json.rb | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/test_json.rb b/tests/test_json.rb index 423053a..eafd758 100755 --- a/tests/test_json.rb +++ b/tests/test_json.rb @@ -109,8 +109,14 @@ class TC_JSON < Test::Unit::TestCase assert_raise(JSON::ParserError) { JSON.parse('', :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') } |