diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/ruby/test_dir_m17n.rb | 11 | ||||
-rw-r--r-- | test/ruby/test_io_m17n.rb | 11 |
2 files changed, 22 insertions, 0 deletions
diff --git a/test/ruby/test_dir_m17n.rb b/test/ruby/test_dir_m17n.rb index 33ba9e1557..b376393abf 100644 --- a/test/ruby/test_dir_m17n.rb +++ b/test/ruby/test_dir_m17n.rb @@ -214,6 +214,17 @@ class TestDir_M17N < Test::Unit::TestCase } end + def test_error_nonascii + bug6071 = '[ruby-dev:45279]' + paths = ["\u{3042}".encode("sjis"), "\u{ff}".encode("iso-8859-1")] + encs = with_tmpdir { + paths.map {|path| + Dir.open(path) rescue $!.message.encoding + } + } + 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")] diff --git a/test/ruby/test_io_m17n.rb b/test/ruby/test_io_m17n.rb index 13d792b633..2f71356f8e 100644 --- a/test/ruby/test_io_m17n.rb +++ b/test/ruby/test_io_m17n.rb @@ -2326,6 +2326,17 @@ EOT } end if /mswin|mingw/ =~ RUBY_PLATFORM + def test_error_nonascii + bug6071 = '[ruby-dev:45279]' + paths = ["\u{3042}".encode("sjis"), "\u{ff}".encode("iso-8859-1")] + encs = with_tmpdir { + paths.map {|path| + open(path) rescue $!.message.encoding + } + } + 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")] |