summaryrefslogtreecommitdiffstats
path: root/test/ruby
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-12-26 03:07:08 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-12-26 03:07:08 +0000
commitf60f6e0b59cec6972bdfaec73b317060f9ef3f94 (patch)
tree0eacaf1c46a2a96f82f7262e21c588b247bc9983 /test/ruby
parentaa266d0c73a1a8756ed04270b43197d787c6f417 (diff)
downloadruby-f60f6e0b59cec6972bdfaec73b317060f9ef3f94.tar.gz
ruby-f60f6e0b59cec6972bdfaec73b317060f9ef3f94.tar.xz
ruby-f60f6e0b59cec6972bdfaec73b317060f9ef3f94.zip
add a test.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@14712 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby')
-rw-r--r--test/ruby/test_io_m17n.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/ruby/test_io_m17n.rb b/test/ruby/test_io_m17n.rb
index ccb74103f..ef28ff15c 100644
--- a/test/ruby/test_io_m17n.rb
+++ b/test/ruby/test_io_m17n.rb
@@ -166,6 +166,18 @@ EOT
}
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")