[前][次][番号順一覧][スレッド一覧]

ruby-changes:15160

From: muraken <ko1@a...>
Date: Thu, 25 Mar 2010 11:41:13 +0900 (JST)
Subject: [ruby-changes:15160] Ruby:r27039 (trunk): * test/ruby/test_dir_m17n.rb: HFS+ escapes invalid byte sequences of filenames.

muraken	2010-03-25 11:37:22 +0900 (Thu, 25 Mar 2010)

  New Revision: 27039

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=27039

  Log:
    * test/ruby/test_dir_m17n.rb: HFS+ escapes invalid byte sequences of filenames.

  Modified files:
    trunk/ChangeLog
    trunk/test/ruby/test_dir_m17n.rb

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 27038)
+++ ChangeLog	(revision 27039)
@@ -1,3 +1,8 @@
+Thu Mar 25 11:34:00 2010  Kenta Murata  <mrkn@m...>
+
+	* test/ruby/test_dir_m17n.rb: HFS+ escapes invalid byte sequences of
+	  filenames.
+
 Thu Mar 25 05:44:31 2010  Nobuyoshi Nakada  <nobu@r...>
 
 	* configure.in (ruby_version): needs runnable CPP.
Index: test/ruby/test_dir_m17n.rb
===================================================================
--- test/ruby/test_dir_m17n.rb	(revision 27038)
+++ test/ruby/test_dir_m17n.rb	(revision 27039)
@@ -30,13 +30,13 @@
         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 @@
         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 @@
         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 @@
         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
 

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]