diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-04-18 07:20:53 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-04-18 07:20:53 +0000 |
commit | a4188556d3735aec2fba15372f73826c16d1af05 (patch) | |
tree | 6753c1faf0de8a92fac564bf580dbfbbb61d7657 /test | |
parent | c3db44dc35a0ea43a0a79c487b852b200aed73ae (diff) |
dir.c: not skip dot directories if matching
* dir.c (glob_helper): should skip dot directories only for recursion,
but should not if matching to the given pattern. [ruby-core:54387]
[Bug #8283]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40345 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r-- | test/ruby/test_dir.rb | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/test/ruby/test_dir.rb b/test/ruby/test_dir.rb index 21902298c0..1c8f73e20c 100644 --- a/test/ruby/test_dir.rb +++ b/test/ruby/test_dir.rb @@ -177,6 +177,15 @@ class TestDir < Test::Unit::TestCase assert_equal(["a/b/c/d/e/f"], Dir.glob("a/**/c/?/e/f"), bug6977) assert_equal(["a/b/c/d/e/f"], Dir.glob("a/**/c/**/d/e/f"), bug6977) assert_equal(["a/b/c/d/e/f"], Dir.glob("a/**/c/**/d/e/f"), bug6977) + + bug8283 = '[ruby-core:54387] [Bug #8283]' + dirs = ["a/.x", "a/b/.y"] + FileUtils.mkdir_p(dirs) + dirs.map {|dir| open("#{dir}/z", "w") {}} + assert_equal([], Dir.glob("a/**/z").sort, bug8283) + assert_equal(["a/.x/z"], Dir.glob("a/**/.x/z"), bug8283) + assert_equal(["a/.x/z"], Dir.glob("a/.x/**/z"), bug8283) + assert_equal(["a/b/.y/z"], Dir.glob("a/**/.y/z"), bug8283) end end |