summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorFlorian Frank <flori@ping.de>2011-07-31 01:00:36 +0200
committerFlorian Frank <flori@ping.de>2011-07-31 01:57:19 +0200
commit86bd839402eae91a1703fdfe6e1ae8267f39f030 (patch)
tree0f20c9c4fb7e0c242308c1920ea483ac09e99e1b /tests
parent42db6f6ad04057f6d6cbbfd68652b71815c8fe47 (diff)
parent9d0b1ca629f6f5bc558a4b3f887f0f8cf154fe78 (diff)
downloadjson-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-xtests/test_json.rb6
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') }