aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormuraken <muraken@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-03-25 02:37:22 +0000
committermuraken <muraken@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-03-25 02:37:22 +0000
commit31bc607cf183193a151584afea3a6ca8d40506e2 (patch)
tree8311c83952442a0dee8c89fdb043bda2f6a7dd16
parentda8a31bc47294936806479b25d60b8d823df8c47 (diff)
downloadruby-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
-rw-r--r--ChangeLog5
-rw-r--r--test/ruby/test_dir_m17n.rb19
2 files changed, 16 insertions, 8 deletions
diff --git a/ChangeLog b/ChangeLog
index 57e4e0897d..82307b0eaf 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Thu Mar 25 11:34:00 2010 Kenta Murata <mrkn@mrkn.jp>
+
+ * test/ruby/test_dir_m17n.rb: HFS+ escapes invalid byte sequences of
+ filenames.
+
Thu Mar 25 05:44:31 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
* configure.in (ruby_version): needs runnable CPP.
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