diff options
| author | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-12-23 15:06:14 +0000 |
|---|---|---|
| committer | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-12-23 15:06:14 +0000 |
| commit | a73184197216a3d4f22e4f73289fdb1543ec293a (patch) | |
| tree | a61c3949c5f3d88fe1e5e09c01e71b3bbd879101 /test/ruby | |
| parent | eec614afc3df9cdfee349fe2ae4cfa00e4cc3ee2 (diff) | |
| download | ruby-a73184197216a3d4f22e4f73289fdb1543ec293a.tar.gz ruby-a73184197216a3d4f22e4f73289fdb1543ec293a.tar.xz ruby-a73184197216a3d4f22e4f73289fdb1543ec293a.zip | |
move the test for [ruby-core:14288].
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@14525 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby')
| -rw-r--r-- | test/ruby/test_io_m17n.rb | 22 |
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 000000000..43f3c3ce0 --- /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 + |
