aboutsummaryrefslogtreecommitdiffstats
path: root/test/ruby/test_dir_m17n.rb
diff options
context:
space:
mode:
authornaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-07-24 08:47:51 +0000
committernaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-07-24 08:47:51 +0000
commit756b6e661b7af89db464e369fca63237c7d65710 (patch)
tree849e3469a9bfcfc50d4dcb8dbb9f96a59f7ddbb5 /test/ruby/test_dir_m17n.rb
parent8122db83ce2110883ec7e50bcbecbaa16c342fd3 (diff)
downloadruby-756b6e661b7af89db464e369fca63237c7d65710.tar.gz
Add the case of Unix: filesystem encoding maybe US-ASCII.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36519 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, 3 insertions, 1 deletions
diff --git a/test/ruby/test_dir_m17n.rb b/test/ruby/test_dir_m17n.rb
index 9485ee8ba4..d3f68fe588 100644
--- a/test/ruby/test_dir_m17n.rb
+++ b/test/ruby/test_dir_m17n.rb
@@ -196,7 +196,9 @@ class TestDir_M17N < Test::Unit::TestCase
EOS
assert_ruby_status(%w[-EASCII-8BIT], <<-'EOS', nil, :chdir=>d)
filename = "\xA4\xA2".force_encoding('ASCII-8BIT')
- win_expected_filename = filename.force_encoding("euc-jp").encode(Encoding.find("filesystem")) rescue "?"
+ win_expected_filename =
+ [Encoding::US_ASCII, Encoding::ASCII_8BIT].include?(Encoding.find("filesystem")) \
+ ? filename : filename.encode(Encoding.find("filesystem"), "euc-jp") rescue "?"
opts = {:encoding => Encoding.default_external} if /mswin|mingw/ =~ RUBY_PLATFORM
ents = Dir.entries(".", opts)
result = ents.include?(filename) ||