-
-
Notifications
You must be signed in to change notification settings - Fork 247
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Do not throw on unfinished !( extglob patterns
There were some magic numbers that assumed that every extglob pattern starts and ends with a specific number of characters in the regular expression. Since !(||) patterns are a little bit more complicated, this led to creating an invalid regular expression and throwing. Fixes isaacs/node-glob#278
- Loading branch information
Showing
2 changed files
with
32 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
var t = require('tap') | ||
var mm = require('../') | ||
|
||
var types = '!?+*@'.split('') | ||
|
||
t.plan(types.length) | ||
types.forEach(function (type) { | ||
t.test(type, function (t) { | ||
t.plan(2) | ||
t.ok(mm(type + '(a|B', type + '(a|B', { nonegate: true })) | ||
t.notOk(mm(type + '(a|B', 'B', { nonegate: true })) | ||
}) | ||
}) |