summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authornaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-11-23 18:23:03 +0000
committernaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-11-23 18:23:03 +0000
commit3ab82a65d701db47cea2ccbe9e7821468e71dd90 (patch)
tree68db643ca6085ee513b6e6396a659c66c3353d88 /test
parent952006388f528513c43eb105857fda761d5a9273 (diff)
* enc/trans/utf_16_32.trans: raise error on unpaired upper
surrogates. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29891 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r--test/ruby/test_transcode.rb2
1 files changed, 2 insertions, 0 deletions
diff --git a/test/ruby/test_transcode.rb b/test/ruby/test_transcode.rb
index 0a12405c20..bf4ca2bf6d 100644
--- a/test/ruby/test_transcode.rb
+++ b/test/ruby/test_transcode.rb
@@ -1023,6 +1023,8 @@ class TestTranscode < Test::Unit::TestCase
expected = "\u{3042}\u{3044}\u{20bb7}"
assert_equal(expected, %w/fffe4230443042d8b7df/.pack("H*").encode("UTF-8","UTF-16"))
assert_equal(expected, %w/feff30423044d842dfb7/.pack("H*").encode("UTF-8","UTF-16"))
+ assert_raise(Encoding::InvalidByteSequenceError){%w/feffdfb7/.pack("H*").encode("UTF-8","UTF-16"))
+ assert_raise(Encoding::InvalidByteSequenceError){%w/fffeb7df/.pack("H*").encode("UTF-8","UTF-16"))
end
def check_utf_32_both_ways(utf8, raw)