diff options
| author | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-08-11 22:49:15 +0000 |
|---|---|---|
| committer | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-08-11 22:49:15 +0000 |
| commit | ae3d15116f085d154e7f29fdf28a261d8210707c (patch) | |
| tree | 6c8bc280c933afe5d615fa74747c8ad48abea7bc /test/ruby/test_transcode.rb | |
| parent | 039fed0ef5390d5f8015f89b413ed6eb42c79033 (diff) | |
| download | ruby-ae3d15116f085d154e7f29fdf28a261d8210707c.tar.gz ruby-ae3d15116f085d154e7f29fdf28a261d8210707c.tar.xz ruby-ae3d15116f085d154e7f29fdf28a261d8210707c.zip | |
add a test.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@18504 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/test_transcode.rb')
| -rw-r--r-- | test/ruby/test_transcode.rb | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/test/ruby/test_transcode.rb b/test/ruby/test_transcode.rb index d3bcb77c3..5d3827452 100644 --- a/test/ruby/test_transcode.rb +++ b/test/ruby/test_transcode.rb @@ -252,6 +252,13 @@ class TestTranscode < Test::Unit::TestCase "\xF0\x80\x80\x42".encode('UTF-16BE', 'UTF-8', invalid: :ignore)) assert_equal(''.force_encoding('UTF-16BE'), "\x82\xAB".encode('UTF-16BE', 'UTF-8', invalid: :ignore)) + + assert_equal("\e$B!!\e(B".force_encoding("ISO-2022-JP"), + "\xA1\xA1\xFF".encode("ISO-2022-JP", "EUC-JP", invalid: :ignore)) + assert_equal("\e$B\x24\x22\x24\x24\e(B".force_encoding("ISO-2022-JP"), + "\xA4\xA2\xFF\xA4\xA4".encode("ISO-2022-JP", "EUC-JP", invalid: :ignore)) + assert_equal("\e$B\x24\x22\x24\x24\e(B".force_encoding("ISO-2022-JP"), + "\xA4\xA2\xFF\xFF\xA4\xA4".encode("ISO-2022-JP", "EUC-JP", invalid: :ignore)) end def test_invalid_replace @@ -306,6 +313,10 @@ class TestTranscode < Test::Unit::TestCase assert_equal("\e$B!!\e(B?".force_encoding("ISO-2022-JP"), "\xA1\xA1\xFF".encode("ISO-2022-JP", "EUC-JP", invalid: :replace)) + assert_equal("\e$B\x24\x22\e(B?\e$B\x24\x24\e(B".force_encoding("ISO-2022-JP"), + "\xA4\xA2\xFF\xA4\xA4".encode("ISO-2022-JP", "EUC-JP", invalid: :replace)) + assert_equal("\e$B\x24\x22\e(B??\e$B\x24\x24\e(B".force_encoding("ISO-2022-JP"), + "\xA4\xA2\xFF\xFF\xA4\xA4".encode("ISO-2022-JP", "EUC-JP", invalid: :replace)) end def test_undef_replace |
