1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

add a test.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14712 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
akr 2007-12-26 03:07:08 +00:00
parent db5a25f3f3
commit 8ffd1eb2a4

View file

@ -166,6 +166,18 @@ EOT
} }
end 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 def test_nonascii_terminator
with_tmpdir { with_tmpdir {
generate_file('tmp', "before \xA2\xA2 after") generate_file('tmp', "before \xA2\xA2 after")