summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-02-25 06:59:39 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-02-25 06:59:39 +0000
commitf4726dcdaa421fa9bb2077b5de195acc5e3d4271 (patch)
treedb0fe968faa6d2cf848bd281cefe4f231990056d /test
parentca3f71b8b57c5fc4f525d813bc07911cabe25130 (diff)
dir.c: same encoding to the pattern
* dir.c (push_pattern, push_glob): make globbed file names same encoding to the given pattern. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49744 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r--test/ruby/test_dir_m17n.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/test/ruby/test_dir_m17n.rb b/test/ruby/test_dir_m17n.rb
index 04186e54a7..f8fc1ef5e4 100644
--- a/test/ruby/test_dir_m17n.rb
+++ b/test/ruby/test_dir_m17n.rb
@@ -362,6 +362,15 @@ class TestDir_M17N < Test::Unit::TestCase
end
end
+ def test_glob_encoding
+ with_tmpdir do
+ %W"file_one.ext file_two.ext".each {|f| open(f, "w") {}}
+ a = "file_one*".force_encoding Encoding::IBM437
+ b = "file_two*".force_encoding Encoding::EUC_JP
+ assert_equal([a, b].map(&:encoding), Dir[a, b].map(&:encoding))
+ end
+ end
+
def test_entries_compose
bug7267 = '[ruby-core:48745] [Bug #7267]'