diff options
Diffstat (limited to 'test')
-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 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 diff --git a/test/ruby/test_io_m17n.rb b/test/ruby/test_io_m17n.rb index 02e60fb62f..d8916433ad 100644 --- a/test/ruby/test_io_m17n.rb +++ b/test/ruby/test_io_m17n.rb @@ -2367,4 +2367,15 @@ EOT } assert_equal(paths.map(&:encoding), encs, bug6071) 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| + open(path, "wb") {|f| f.inspect.encoding} + } + } + assert_equal(paths.map(&:encoding), encs, bug6072) + end end |