ruby-changes:7589
From: akr <ko1@a...>
Date: Thu, 4 Sep 2008 03:22:34 +0900 (JST)
Subject: [ruby-changes:7589] Ruby:r19110 (trunk): add tests.
akr 2008-09-04 03:22:21 +0900 (Thu, 04 Sep 2008) New Revision: 19110 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=19110 Log: add tests. Modified files: trunk/test/ruby/test_io_m17n.rb Index: test/ruby/test_io_m17n.rb =================================================================== --- test/ruby/test_io_m17n.rb (revision 19109) +++ test/ruby/test_io_m17n.rb (revision 19110) @@ -791,6 +791,21 @@ } 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") -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/