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

ruby-changes:41807

From: nobu <ko1@a...>
Date: Sat, 20 Feb 2016 18:35:39 +0900 (JST)
Subject: [ruby-changes:41807] nobu:r53881 (trunk): test_dir_m17n.rb: fix ASCII-8BIT env

nobu	2016-02-20 18:36:08 +0900 (Sat, 20 Feb 2016)

  New Revision: 53881

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=53881

  Log:
    test_dir_m17n.rb: fix ASCII-8BIT env
    
    * test/ruby/test_dir_m17n.rb (test_glob_encoding): get rid of
      conversion when LC_ALL=C and filesystem encoding is ASCII-8BIT.
      [ruby-core:73868] [Bug #12081]

  Modified files:
    trunk/test/ruby/test_dir_m17n.rb
Index: test/ruby/test_dir_m17n.rb
===================================================================
--- test/ruby/test_dir_m17n.rb	(revision 53880)
+++ test/ruby/test_dir_m17n.rb	(revision 53881)
@@ -375,7 +375,14 @@ class TestDir_M17N < Test::Unit::TestCas https://github.com/ruby/ruby/blob/trunk/test/ruby/test_dir_m17n.rb#L375
       list << dir
       bug12081 = '[ruby-core:73868] [Bug #12081]'
       a = "*".force_encoding("us-ascii")
-      assert_equal(list, Dir[a].map {|n| n.encode(Encoding::UTF_8)}.sort, bug12081)
+      result = Dir[a].map {|n|
+        if n.encoding == Encoding::ASCII_8BIT
+          n.force_encoding(Encoding::UTF_8)
+        else
+          n.encode(Encoding::UTF_8)
+        end
+      }
+      assert_equal(list, result.sort!, bug12081)
     end
   end
 

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

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