summaryrefslogtreecommitdiff
path: root/test/ruby/test_dir_m17n.rb
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-02-24 22:53:51 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-02-24 22:53:51 +0000
commiteec0b2d88a68d7931ff1d41c5cc2c773f7f22c6c (patch)
tree42449d482126683b6649ddf0eb58ce43484bb6e7 /test/ruby/test_dir_m17n.rb
parent85738261a582ceef498b86b784171fba59bf60cc (diff)
* 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/trunk@34795 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/test_dir_m17n.rb')
-rw-r--r--test/ruby/test_dir_m17n.rb13
1 files changed, 12 insertions, 1 deletions
diff --git a/test/ruby/test_dir_m17n.rb b/test/ruby/test_dir_m17n.rb
index 1f5b03a905..b376393abf 100644
--- a/test/ruby/test_dir_m17n.rb
+++ b/test/ruby/test_dir_m17n.rb
@@ -224,5 +224,16 @@ class TestDir_M17N < Test::Unit::TestCase
}
assert_equal(paths.map(&:encoding), encs, bug6071)
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