Project

General

Profile

Bug #15540 ยป 0001-dir.c-fix-Dir.glob-with-braces-and-matching-dir.patch

h.shirosaki (Hiroshi Shirosaki), 01/16/2019 05:39 AM

View differences:

dir.c
case RECURSIVE:
str = "**";
break;
case MATCH_DIR:
/* append last slash */
str = "";
break;
default:
str = p->str;
if (!str) continue;
test/ruby/test_dir.rb
end
end
def test_glob_recursive_directory
Dir.chdir(@root) do
['d', 'e'].each do |path|
FileUtils.mkdir_p("c/#{path}/a/b/c")
FileUtils.touch("c/#{path}/a/a.file")
FileUtils.touch("c/#{path}/a/b/b.file")
FileUtils.touch("c/#{path}/a/b/c/c.file")
end
bug15540 = '[ruby-core:91110] [Bug #15540]'
assert_equal(["c/d/a/", "c/d/a/b/", "c/d/a/b/c/", "c/e/a/", "c/e/a/b/", "c/e/a/b/c/"],
Dir.glob('c/{d,e}/a/**/'), bug15540)
end
end
if Process.const_defined?(:RLIMIT_NOFILE)
def test_glob_too_may_open_files
assert_separately([], "#{<<-"begin;"}\n#{<<-'end;'}", chdir: @root)
    (1-1/1)