From a4188556d3735aec2fba15372f73826c16d1af05 Mon Sep 17 00:00:00 2001 From: nobu Date: Thu, 18 Apr 2013 07:20:53 +0000 Subject: 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 --- test/ruby/test_dir.rb | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'test/ruby/test_dir.rb') 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 -- cgit v1.2.3