diff options
author | muraken <muraken@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-03-25 02:37:22 +0000 |
---|---|---|
committer | muraken <muraken@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-03-25 02:37:22 +0000 |
commit | 31bc607cf183193a151584afea3a6ca8d40506e2 (patch) | |
tree | 8311c83952442a0dee8c89fdb043bda2f6a7dd16 /test | |
parent | da8a31bc47294936806479b25d60b8d823df8c47 (diff) | |
download | ruby-31bc607cf183193a151584afea3a6ca8d40506e2.tar.gz |
* test/ruby/test_dir_m17n.rb: HFS+ escapes invalid byte sequences of filenames.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27039 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r-- | test/ruby/test_dir_m17n.rb | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/test/ruby/test_dir_m17n.rb b/test/ruby/test_dir_m17n.rb index fb37fe1342..3f8ebe075a 100644 --- a/test/ruby/test_dir_m17n.rb +++ b/test/ruby/test_dir_m17n.rb @@ -30,13 +30,13 @@ class TestDir_M17N < Test::Unit::TestCase filename = "\xff".force_encoding("ASCII-8BIT") # invalid byte sequence as UTF-8 File.open(filename, "w") {} ents = Dir.entries(".") - exit ents.include?(filename) + exit ents.include?(filename) || (RUBY_PLATFORM =~ /darwin/ && ents.include?("%FF")) EOS assert_ruby_status(%w[-EUTF-8], <<-'EOS', nil, :chdir=>d) filename = "\xff".force_encoding("UTF-8") # invalid byte sequence as UTF-8 File.open(filename, "w") {} ents = Dir.entries(".") - exit ents.include?(filename) + exit ents.include?(filename) || (RUBY_PLATFORM =~ /darwin/ && ents.include?("%FF")) EOS } end @@ -136,7 +136,8 @@ class TestDir_M17N < Test::Unit::TestCase File.open(filename, "w") {} ents = Dir.entries(".") ents.each {|e| e.force_encoding("ASCII-8BIT") } - exit ents.include?(filename.force_encoding("ASCII-8BIT")) + exit ents.include?(filename.force_encoding("ASCII-8BIT")) || + (RUBY_PLATFORM =~ /darwin/ && ents.include?("%A4%A2".force_encoding("ASCII-8BIT"))) EOS } end @@ -147,12 +148,14 @@ class TestDir_M17N < Test::Unit::TestCase filename = "\xA4\xA2".force_encoding("euc-jp") File.open(filename, "w") {} ents = Dir.entries(".") - exit ents.include?(filename) + exit ents.include?(filename) || + (RUBY_PLATFORM =~ /darwin/ && ents.include?("%A4%A2".force_encoding("euc-jp"))) EOS assert_ruby_status(%w[-EASCII-8BIT], <<-'EOS', nil, :chdir=>d) filename = "\xA4\xA2" ents = Dir.entries(".") - exit ents.include?(filename) + exit ents.include?(filename) || + (RUBY_PLATFORM =~ /darwin/ && ents.include?("%A4%A2".force_encoding("ASCII-8BIT"))) EOS } end @@ -179,15 +182,15 @@ class TestDir_M17N < Test::Unit::TestCase filename = "\xA4\xA2".force_encoding("euc-jp") File.open(filename, "w") {} ents = Dir.entries(".") - exit ents.include?(filename) + exit ents.include?(filename) || + (RUBY_PLATFORM =~ /darwin/ && ents.include?("%A4%A2".force_encoding("euc-jp"))) EOS assert_ruby_status(%w[-EEUC-JP:UTF-8], <<-'EOS', nil, :chdir=>d) filename = "\u3042" ents = Dir.entries(".") - exit ents.include?(filename) + exit ents.include?(filename) || (RUBY_PLATFORM =~ /darwin/ && ents.include?("%A4%A2")) EOS } end - end |