ruby-changes:28817
From: naruse <ko1@a...>
Date: Tue, 21 May 2013 15:08:16 +0900 (JST)
Subject: [ruby-changes:28817] naruse:r40869 (trunk): force_encoding expected result as filesystem encoding
naruse 2013-05-21 15:08:04 +0900 (Tue, 21 May 2013) New Revision: 40869 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=40869 Log: force_encoding expected result as filesystem encoding Modified files: trunk/test/ruby/test_dir_m17n.rb Index: test/ruby/test_dir_m17n.rb =================================================================== --- test/ruby/test_dir_m17n.rb (revision 40868) +++ test/ruby/test_dir_m17n.rb (revision 40869) @@ -320,6 +320,10 @@ class TestDir_M17N < Test::Unit::TestCas https://github.com/ruby/ruby/blob/trunk/test/ruby/test_dir_m17n.rb#L320 if /mswin|mingw/ =~ RUBY_PLATFORM opts = {:encoding => Encoding.default_external} orig.map! {|o| o.encode(Encoding.find("filesystem")) rescue o.tr("^a-z", "?")} + else + enc = Encoding.find("filesystem") + enc = Encoding::ASCII_8BIT if enc == Encoding::US_ASCII + orig.map {|o| o.force_encoding(enc) } end ents = Dir.entries(".", opts).reject {|n| /\A\./ =~ n} pp.assert_equal(orig, ents, bug7267) -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/