diff --git a/index.js b/index.js index 6756cee..abe1888 100644 --- a/index.js +++ b/index.js @@ -31,7 +31,6 @@ async function walk(output, prefix, lexer, opts, dirname='', level=0) { continue; } - if (rgx && !rgx.test(file)) continue; !filesOnly && isMatch && output.push(join(prefix, relpath)); await walk(output, prefix, lexer, opts, relpath, rgx && rgx.toString() !== lexer.globstar && ++level); diff --git a/test/fixtures/two/child/a.txt b/test/fixtures/two/child/a.txt new file mode 100644 index 0000000..e69de29 diff --git a/test/glob.js b/test/glob.js index 13a4529..cf47091 100644 --- a/test/glob.js +++ b/test/glob.js @@ -19,7 +19,7 @@ test('glob: standard', async t => { }); test('glob: glob', async t => { - t.plan(14); + t.plan(15); t.same(await glob(''), []); t.same(await glob('.'), ['.']); @@ -81,7 +81,16 @@ test('glob: glob', async t => { 'one/b.txt', 'one/child/a.js', 'one/child/a.txt', - 'two/a.txt' + 'two/a.txt', + 'two/child/a.txt' + ]); + + await isMatch(t, '{one,two}/**/*.{txt}', {cwd: join(__dirname, 'fixtures')}, [ + 'one/a.txt', + 'one/b.txt', + 'one/child/a.txt', + 'two/a.txt', + 'two/child/a.txt' ]); });