diff options
author | duerst <duerst@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-07-25 01:01:38 +0000 |
---|---|---|
committer | duerst <duerst@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-07-25 01:01:38 +0000 |
commit | 3e53486295797ef5a2df6a4d684381d6f7d4af66 (patch) | |
tree | 4b88cd218310ca75096723a44f331d5a338fe460 | |
parent | 32eca113251515c013934bfcd7994b7c18a13004 (diff) | |
download | ruby-3e53486295797ef5a2df6a4d684381d6f7d4af66.tar.gz |
* test/ruby/test_transcode.rb: refactoring/cleanup of
test_iso_2022_jp(_1)
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18203 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | test/ruby/test_transcode.rb | 15 |
2 files changed, 13 insertions, 7 deletions
@@ -1,3 +1,8 @@ +Fri Jul 25 10:00:00 2008 Martin Duerst <duerst@it.aoyama.ac.jp> + + * test/ruby/test_transcode.rb: refactoring/cleanup of + test_iso_2022_jp(_1) + Fri Jul 25 04:12:57 2008 NARUSE, Yui <naruse@ruby-lang.org> * ext/nkf/nkf.c (rb_nkf_convert): output of mime encode is US-ASCII. diff --git a/test/ruby/test_transcode.rb b/test/ruby/test_transcode.rb index 73f2f61832..33d80e1adf 100644 --- a/test/ruby/test_transcode.rb +++ b/test/ruby/test_transcode.rb @@ -257,15 +257,16 @@ class TestTranscode < Test::Unit::TestCase def test_iso_2022_jp assert_raise(RuntimeError) { "\x1b(A".encode("utf-8", "iso-2022-jp") } assert_raise(RuntimeError) { "\x1b$(A".encode("utf-8", "iso-2022-jp") } - assert_equal("\uff71\uff72\uff73\uff74\uff75", - "\x1b(I12345\x1b(B".force_encoding("iso-2022-jp").encode("utf-8")) # JIS X 0201 ァィゥェォ - assert_equal("\u9299", "\x1b$(Dd!\x1b(B".encode("utf-8", "iso-2022-jp")) # JIS X 0212 区68 点01 銙 assert_raise(RuntimeError) { "\x1b$C".encode("utf-8", "iso-2022-jp") } assert_raise(RuntimeError) { "\x1e".encode("utf-8", "iso-2022-jp") } assert_raise(RuntimeError) { "\x80".encode("utf-8", "iso-2022-jp") } - - assert_equal("\x1b(I12345\x1b(B".force_encoding("iso-2022-jp"), - "\uff71\uff72\uff73\uff74\uff75".encode("iso-2022-jp")) - assert_equal("\x1b$(Dd!\x1b(B".force_encoding("iso-2022-jp"), "\u9299".encode("iso-2022-jp")) + assert_raise(RuntimeError) { "\x1b$(Dd!\x1b(B".encode("utf-8", "iso-2022-jp") } + assert_raise(RuntimeError) { "\u9299".encode("iso-2022-jp") } + #@@@@ TODO: the next test should actually fail, because iso-2022-jp does not include half-width kana + check_both_ways("\uff71\uff72\uff73\uff74\uff75", "\x1b(I12345\x1b(B", "iso-2022-jp") # JIS X 0201 ァィゥェォ + end + + def test_iso_2022_jp_1 + # check_both_ways("\u9299", "\x1b$(Dd!\x1b(B", "iso-2022-jp-1") # JIS X 0212 区68 点01 銙 end end |