aboutsummaryrefslogtreecommitdiffstats
path: root/test/ruby/test_dir_m17n.rb
diff options
context:
space:
mode:
authornaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-05-21 06:08:04 +0000
committernaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-05-21 06:08:04 +0000
commit32c5c675f2e38ab1bb40b9310b63a535a73cb116 (patch)
treec163f549e40533306f3c8556eddc99ef0454906f /test/ruby/test_dir_m17n.rb
parent1891b60f268780fe4e9d970ffa759c3d7dd0e00b (diff)
downloadruby-32c5c675f2e38ab1bb40b9310b63a535a73cb116.tar.gz
force_encoding expected result as filesystem encoding
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40869 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/test_dir_m17n.rb')
-rw-r--r--test/ruby/test_dir_m17n.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/test/ruby/test_dir_m17n.rb b/test/ruby/test_dir_m17n.rb
index 2f8b1baef3..9e72e19695 100644
--- a/test/ruby/test_dir_m17n.rb
+++ b/test/ruby/test_dir_m17n.rb
@@ -320,6 +320,10 @@ class TestDir_M17N < Test::Unit::TestCase
if /mswin|mingw/ =~ RUBY_PLATFORM
opts = {:encoding => Encoding.default_external}
orig.map! {|o| o.encode(Encoding.find("filesystem")) rescue o.tr("^a-z", "?")}
+ else
+ enc = Encoding.find("filesystem")
+ enc = Encoding::ASCII_8BIT if enc == Encoding::US_ASCII
+ orig.map {|o| o.force_encoding(enc) }
end
ents = Dir.entries(".", opts).reject {|n| /\A\./ =~ n}
pp.assert_equal(orig, ents, bug7267)