diff options
author | Florian Frank <flori@ping.de> | 2017-03-23 14:26:12 +0100 |
---|---|---|
committer | Florian Frank <flori@ping.de> | 2017-04-18 10:38:41 +0200 |
commit | f94da5a9bf3dfe841ff217e4c2d0c9a13252c627 (patch) | |
tree | 7b455a9f90537bf2b6b6143816f3e6e76e888438 /tests | |
parent | 8f782fd8e181d9cfe9387ded43a5ca9692266b85 (diff) | |
download | json-f94da5a9bf3dfe841ff217e4c2d0c9a13252c627.tar.gz |
Raise exception
for incomplete unicode surrogates/character escape sequences
Diffstat (limited to 'tests')
-rw-r--r-- | tests/json_encoding_test.rb | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/tests/json_encoding_test.rb b/tests/json_encoding_test.rb index 29ae02e..4e086ef 100644 --- a/tests/json_encoding_test.rb +++ b/tests/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 |