ruby-changes:3219
From: ko1@a...
Date: 26 Dec 2007 12:07:26 +0900
Subject: [ruby-changes:3219] akr - Ruby:r14712 (trunk): add a test.
akr 2007-12-26 12:07:08 +0900 (Wed, 26 Dec 2007)
New Revision: 14712
Modified files:
trunk/test/ruby/test_io_m17n.rb
Log:
add a test.
http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/test/ruby/test_io_m17n.rb?r1=14712&r2=14711
Index: test/ruby/test_io_m17n.rb
===================================================================
--- test/ruby/test_io_m17n.rb (revision 14711)
+++ test/ruby/test_io_m17n.rb (revision 14712)
@@ -166,6 +166,18 @@
}
end
+ def test_terminator_stateful_conversion
+ with_tmpdir {
+ src = "before \e$B\x23\x30\x23\x31\e(B after".force_encoding("iso-2022-jp")
+ generate_file('tmp', src)
+ s = open("tmp", "r:iso-2022-jp:euc-jp") {|f|
+ f.gets("0".force_encoding("euc-jp"))
+ }
+ assert_equal(Encoding.find("euc-jp"), s.encoding)
+ assert_str_equal(src.encode("euc-jp"), s)
+ }
+ end
+
def test_nonascii_terminator
with_tmpdir {
generate_file('tmp', "before \xA2\xA2 after")
--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml