diff --git a/src/util.js b/src/util.js index f688693..1d96eae 100644 --- a/src/util.js +++ b/src/util.js @@ -58,7 +58,7 @@ const createShouldIgnore = options => { } } -const isNegative = pattern => pattern[0] === '!' +const isNegative = pattern => pattern[0] === '!' && pattern[1] !== '(' const isPattern = subject => subject && typeof subject === 'string' const createTasks = (patterns, options) => { diff --git a/test/fixtures/b/a.js b/test/fixtures/b/a.js new file mode 100644 index 0000000..e69de29 diff --git a/test/fixtures/b/b.js b/test/fixtures/b/b.js new file mode 100644 index 0000000..e69de29 diff --git a/test/fixtures/b/b/a.js b/test/fixtures/b/b/a.js new file mode 100644 index 0000000..e69de29 diff --git a/test/fixtures/b/b/b.js b/test/fixtures/b/b/b.js new file mode 100644 index 0000000..e69de29 diff --git a/test/fixtures/b/b/b/a.js b/test/fixtures/b/b/b/a.js new file mode 100644 index 0000000..e69de29 diff --git a/test/fixtures/b/b/b/b.js b/test/fixtures/b/b/b/b.js new file mode 100644 index 0000000..e69de29 diff --git a/test/fixtures/b/b/b/c b/test/fixtures/b/b/b/c new file mode 100644 index 0000000..e69de29 diff --git a/test/fixtures/b/b/c b/test/fixtures/b/b/c new file mode 100644 index 0000000..e69de29 diff --git a/test/fixtures/b/c b/test/fixtures/b/c new file mode 100644 index 0000000..e69de29 diff --git a/test/glob-gitignore.js b/test/glob-gitignore.js index ec1b660..b326cb8 100644 --- a/test/glob-gitignore.js +++ b/test/glob-gitignore.js @@ -16,7 +16,7 @@ const CASES = [ d: 'basic', p: '**/*.js', i: 'a.js', - r: ['b.js', 'a/b.js', 'a/a/b.js', 'a/a/a/b.js'] + r: ['b.js', 'a/b.js', 'a/a/b.js', 'a/a/a/b.js', 'b/b.js', 'b/b/b.js', 'b/b/b/b.js'] }, { d: 'patterns', @@ -33,12 +33,17 @@ const CASES = [ { d: 'without ignore', p: ['**/a.js'], - r: ['a.js', 'a/a.js', 'a/a/a.js', 'a/a/a/a.js'] + r: ['a.js', 'a/a.js', 'a/a/a.js', 'a/a/a/a.js', 'b/a.js', 'b/b/a.js', 'b/b/b/a.js'] }, { d: 'only negative', p: ['!**/a.js'], r: [] + }, + { + d: 'negative prefixed group', + p: '!(a)**/*.js', + r: ['b/b.js', 'b/a.js'] } ]