summaryrefslogtreecommitdiff
path: root/test/ruby
diff options
context:
space:
mode:
authornaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-02-25 12:25:55 +0000
committernaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-02-25 12:25:55 +0000
commit5e808b6ba38dbd974b617e80e2cf054eaaca604f (patch)
tree14d1fb78d676ba0073bc701136cda1d884a40292 /test/ruby
parent1b21d03d76640db4c7c96709b78d973950385b1a (diff)
merge revision(s) 34794,34795:
* dir.c (dir_initialize): keep path in original encoding. * error.c (syserr_initialize): prefer the encoding of message over locale. [ruby-dev:45279][Bug #6071] * 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@34813 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby')
-rw-r--r--test/ruby/test_dir_m17n.rb11
-rw-r--r--test/ruby/test_io_m17n.rb11
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")]