diff options
author | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-09-03 18:22:21 +0000 |
---|---|---|
committer | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-09-03 18:22:21 +0000 |
commit | 8c321128d91fadb45c12bbbbd9637bf81f76be2a (patch) | |
tree | 005fdeb77c84c25a6d043a0e6ab1af7840ad575f /test | |
parent | 58964e324975a924947157ac933d11815f1b2483 (diff) | |
download | ruby-8c321128d91fadb45c12bbbbd9637bf81f76be2a.tar.gz |
add tests.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19110 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r-- | test/ruby/test_io_m17n.rb | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/test/ruby/test_io_m17n.rb b/test/ruby/test_io_m17n.rb index b8b532e94c..67f48527b5 100644 --- a/test/ruby/test_io_m17n.rb +++ b/test/ruby/test_io_m17n.rb @@ -791,6 +791,21 @@ EOT } end + def test_set_encoding_undef_replace + with_pipe {|r, w| + w << "\ufffd" + w.close + r.set_encoding("utf-8", "euc-jp", :undef=>:replace, :replace=>"ZZZ") + assert_equal("ZZZ", r.read) + } + with_pipe {|r, w| + w << "\ufffd" + w.close + r.set_encoding("utf-8:euc-jp", :undef=>:replace, :replace=>"ZZZ") + assert_equal("ZZZ", r.read) + } + end + def test_write_conversion_fixenc with_pipe {|r, w| w.set_encoding("iso-2022-jp:utf-8") |