From ab86bab950ca05d5aca8a738c58500eea7a21227 Mon Sep 17 00:00:00 2001 From: nobu Date: Sat, 20 Feb 2016 09:36:08 +0000 Subject: 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] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53881 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/ruby/test_dir_m17n.rb | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/test/ruby/test_dir_m17n.rb b/test/ruby/test_dir_m17n.rb index c6be8b6109..4efc8ca34d 100644 --- a/test/ruby/test_dir_m17n.rb +++ b/test/ruby/test_dir_m17n.rb @@ -375,7 +375,14 @@ class TestDir_M17N < Test::Unit::TestCase 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 -- cgit v1.2.3