summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-12-23 15:06:14 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-12-23 15:06:14 +0000
commitc534670da1fc7d6ba66fb74b41caebd90ac188c6 (patch)
treea61c3949c5f3d88fe1e5e09c01e71b3bbd879101 /test
parentcf36df97fb74f60b321fe5617b3805078393c028 (diff)
move the test for [ruby-core:14288].
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14525 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r--test/ruby/test_io_m17n.rb22
1 files changed, 22 insertions, 0 deletions
diff --git a/test/ruby/test_io_m17n.rb b/test/ruby/test_io_m17n.rb
new file mode 100644
index 0000000000..43f3c3ce01
--- /dev/null
+++ b/test/ruby/test_io_m17n.rb
@@ -0,0 +1,22 @@
+require 'test/unit'
+require 'tmpdir'
+
+class TestIOM17N < Test::Unit::TestCase
+ def with_tmpdir
+ Dir.mktmpdir {|dir|
+ Dir.chdir dir
+ yield dir
+ }
+ end
+
+ def test_conversion
+ with_tmpdir {
+ open("tmp", "w") {|f| f.write "before \u00FF after" }
+ s = open("tmp", "r:iso-8859-1:utf-8") {|f|
+ f.gets("\xFF".force_encoding("iso-8859-1"))
+ }
+ assert_equal("before \xFF".force_encoding("iso-8859-1"), s, '[ruby-core:14288]')
+ }
+ end
+end
+