diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-02-20 09:36:08 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-02-20 09:36:08 +0000 |
commit | ab86bab950ca05d5aca8a738c58500eea7a21227 (patch) | |
tree | 5021f3b7bd9daad2fc96b2ad5a86f9d6eea66126 /test | |
parent | 68d4d7e41f00ce71a5d737a711278fb7b3c6da12 (diff) |
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
Diffstat (limited to 'test')
-rw-r--r-- | test/ruby/test_dir_m17n.rb | 9 |
1 files changed, 8 insertions, 1 deletions
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 |