1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

add tests.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19301 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
akr 2008-09-12 11:30:53 +00:00
parent 2af2eb28da
commit 0de51bcc75

View file

@ -548,6 +548,8 @@ class TestTranscode < Test::Unit::TestCase
check_both_ways("\u005C", "\x5C", "ISO-2022-JP")
assert_equal("\u005C", "\e(B\x5C\e(B".encode("UTF-8", "ISO-2022-JP"))
assert_equal("\u005C", "\e(J\x5C\e(B".encode("UTF-8", "ISO-2022-JP"))
assert_equal("\u005C", "\x5C".encode("stateless-ISO-2022-JP", "ISO-2022-JP"))
assert_equal("\u005C", "\e(J\x5C\e(B".encode("stateless-ISO-2022-JP", "ISO-2022-JP"))
assert_raise(Encoding::ConversionUndefined) { "\u00A5".encode("Shift_JIS") }
assert_raise(Encoding::ConversionUndefined) { "\u00A5".encode("Windows-31J") }
assert_raise(Encoding::ConversionUndefined) { "\u00A5".encode("EUC-JP") }
@ -571,6 +573,8 @@ class TestTranscode < Test::Unit::TestCase
check_both_ways("\u007E", "\x7E", "ISO-2022-JP")
assert_equal("\u007E", "\e(B\x7E\e(B".encode("UTF-8", "ISO-2022-JP"))
assert_equal("\u007E", "\e(J\x7E\e(B".encode("UTF-8", "ISO-2022-JP"))
assert_equal("\u007E", "\x7E".encode("stateless-ISO-2022-JP", "ISO-2022-JP"))
assert_equal("\u007E", "\e(J\x7E\e(B".encode("stateless-ISO-2022-JP", "ISO-2022-JP"))
assert_raise(Encoding::ConversionUndefined) { "\u203E".encode("Shift_JIS") }
assert_raise(Encoding::ConversionUndefined) { "\u203E".encode("Windows-31J") }
assert_raise(Encoding::ConversionUndefined) { "\u203E".encode("EUC-JP") }