summaryrefslogtreecommitdiffstats
path: root/test/ruby
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-01-03 14:49:38 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-01-03 14:49:38 +0000
commit2944c170c7474455663d0326ef346e313c80b833 (patch)
tree9249d1fe57dc9e74468f26e1dfda7b16caaf4518 /test/ruby
parent1ee6879bdd555a10966781a6de0b6dcc9b8a6e8a (diff)
downloadruby-2944c170c7474455663d0326ef346e313c80b833.tar.gz
ruby-2944c170c7474455663d0326ef346e313c80b833.tar.xz
ruby-2944c170c7474455663d0326ef346e313c80b833.zip
add a test for getc with stateful conversion.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@14872 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby')
-rw-r--r--test/ruby/test_io_m17n.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/ruby/test_io_m17n.rb b/test/ruby/test_io_m17n.rb
index ef28ff15c..748050afe 100644
--- a/test/ruby/test_io_m17n.rb
+++ b/test/ruby/test_io_m17n.rb
@@ -223,6 +223,17 @@ EOT
}
end
+ def test_getc_stateful_conversion
+ with_tmpdir {
+ src = "\e$B\x23\x30\x23\x31\e(B".force_encoding("iso-2022-jp")
+ generate_file('tmp', src)
+ open("tmp", "r:iso-2022-jp:euc-jp") {|f|
+ assert_equal("\xa3\xb0".force_encoding("euc-jp"), f.getc)
+ assert_equal("\xa3\xb1".force_encoding("euc-jp"), f.getc)
+ }
+ }
+ end
+
def test_open_ascii
with_tmpdir {
src = "abc\n"