diff options
author | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-02-25 08:10:23 +0000 |
---|---|---|
committer | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-02-25 08:10:23 +0000 |
commit | f7f7f93a03f013fb957a0e3e99237f16b5bc1fef (patch) | |
tree | bf659f16ad0a53f078185e0b19d388f3b4ee96c7 /test/ruby | |
parent | 7e2e3dc85d8c02672bc7486630424e7df95ef28b (diff) |
merge revision(s) 34795:
* dir.c (dir_inspect), io.c (rb_io_inspect): keep encoding of path.
[Bug #6072]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_3@34810 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby')
-rw-r--r-- | test/ruby/test_dir_m17n.rb | 13 | ||||
-rw-r--r-- | test/ruby/test_io_m17n.rb | 11 |
2 files changed, 23 insertions, 1 deletions
diff --git a/test/ruby/test_dir_m17n.rb b/test/ruby/test_dir_m17n.rb index 6701e0b1a5..33ba9e1557 100644 --- a/test/ruby/test_dir_m17n.rb +++ b/test/ruby/test_dir_m17n.rb @@ -213,5 +213,16 @@ class TestDir_M17N < Test::Unit::TestCase EOS } end -end + def test_inspect_nonascii + bug6072 = '[ruby-dev:45280]' + paths = ["\u{3042}".encode("sjis"), "\u{ff}".encode("iso-8859-1")] + encs = with_tmpdir { + paths.map {|path| + Dir.mkdir(path) + Dir.open(path) {|d| d.inspect.encoding} + } + } + assert_equal(paths.map(&:encoding), encs, bug6072) + end +end diff --git a/test/ruby/test_io_m17n.rb b/test/ruby/test_io_m17n.rb index b7460bf63e..13d792b633 100644 --- a/test/ruby/test_io_m17n.rb +++ b/test/ruby/test_io_m17n.rb @@ -2325,4 +2325,15 @@ EOT end } end if /mswin|mingw/ =~ RUBY_PLATFORM + + def test_inspect_nonascii + bug6072 = '[ruby-dev:45280]' + paths = ["\u{3042}".encode("sjis"), "\u{ff}".encode("iso-8859-1")] + encs = with_tmpdir { + paths.map {|path| + open(path, "wb") {|f| f.inspect.encoding} + } + } + assert_equal(paths.map(&:encoding), encs, bug6072) + end end |