diff options
Diffstat (limited to 'tests/test_json_unicode.rb')
-rwxr-xr-x | tests/test_json_unicode.rb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/test_json_unicode.rb b/tests/test_json_unicode.rb index c328811..66a87d0 100755 --- a/tests/test_json_unicode.rb +++ b/tests/test_json_unicode.rb @@ -69,4 +69,11 @@ class TestJSONUnicode < Test::Unit::TestCase end assert_equal "\302\200", JSON.parse('["\u0080"]').first end + + def test_parsing_invalid_utf8 + assert_raise ArgumentError do + JSON.parse "[\"\xCE\"]", :quirks_mode => true + JSON.parse "[\"\xCE\"]" + end + end end |