summaryrefslogtreecommitdiff
path: root/test/json
diff options
context:
space:
mode:
Diffstat (limited to 'test/json')
-rw-r--r--test/json/json_encoding_test.rb2
-rw-r--r--[-rwxr-xr-x]test/json/json_generator_test.rb0
2 files changed, 2 insertions, 0 deletions
diff --git a/test/json/json_encoding_test.rb b/test/json/json_encoding_test.rb
index 29ae02e563..4e086ef84a 100644
--- a/test/json/json_encoding_test.rb
+++ b/test/json/json_encoding_test.rb
@@ -79,6 +79,8 @@ class JSONEncodingTest < Test::Unit::TestCase
json = '["\ud840\udc01"]'
assert_equal json, generate(utf8, :ascii_only => true)
assert_equal utf8, parse(json)
+ assert_raises(JSON::ParserError) { parse('"\u"') }
+ assert_raises(JSON::ParserError) { parse('"\ud800"') }
end
def test_chars
diff --git a/test/json/json_generator_test.rb b/test/json/json_generator_test.rb
index 86be398f46..86be398f46 100755..100644
--- a/test/json/json_generator_test.rb
+++ b/test/json/json_generator_test.rb