1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

Unix doesn't use win_expected_filename.

r36519's essensial part is not to use filename.force_encoding("euc-jp").

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36521 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
naruse 2012-07-24 09:57:59 +00:00
parent cd1a6ab82b
commit 0daf636e7a

View file

@ -196,9 +196,7 @@ 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 =
[Encoding::US_ASCII, Encoding::ASCII_8BIT].include?(Encoding.find("filesystem")) \
? filename : filename.encode(Encoding.find("filesystem"), "euc-jp") rescue "?"
win_expected_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) ||