Skip to content

Commit

Permalink
Merge pull request #97 from micromatch/unixify-not
Browse files Browse the repository at this point in the history
Bug fix for #96 (.not returning incorrect results on windows)
  • Loading branch information
doowb committed Jul 11, 2017
2 parents 5effb6c + 0fd6207 commit 6ca8ba6
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
3 changes: 2 additions & 1 deletion index.js
Expand Up @@ -344,7 +344,8 @@ micromatch.not = function(list, patterns, options) {
var ignore = opts.ignore;
delete opts.ignore;

list = utils.arrayify(list);
var unixify = utils.unixify(opts);
list = utils.arrayify(list).map(unixify);

var matches = utils.diff(list, micromatch(list, patterns, opts));
if (ignore) {
Expand Down
14 changes: 12 additions & 2 deletions test/support/match.js
Expand Up @@ -73,6 +73,16 @@ module.exports.create = function() {
return matcher.create.apply(null, arguments);
};

module.exports.not = function() {
return matcher.not.apply(null, arguments);
module.exports.not = function(fixtures, patterns, expected, options) {
if (!Array.isArray(expected)) {
var tmp = expected;
expected = options;
options = tmp;
}

var actual = matcher.not(fixtures, patterns, options);
expected.sort(compare);
actual.sort(compare);

assert.deepEqual(actual, expected, patterns);
};

0 comments on commit 6ca8ba6

Please sign in to comment.