-
-
Notifications
You must be signed in to change notification settings - Fork 20
/
Copy pathbash.spec.js
36 lines (30 loc) · 1.02 KB
/
bash.spec.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
'use strict';
var path = require('path');
var assert = require('assert');
var forOwn = require('for-own');
var parse = require('./support/parse');
var mm = require('./support/matcher');
describe('bash.spec', function() {
var fixtures = parse('*.txt', {cwd: path.join(__dirname, 'fixtures')});
forOwn(fixtures, function(lines, filename) {
describe(filename + ':', function() {
lines.forEach(function(line) {
if (typeof line === 'string') {
console.log(line);
return;
}
var fixture = line[0];
var pattern = line[1];
var expected = line[2];
var title = '"' + fixture
+ '" should' + (expected ? '' : ' not')
+ ' match "' + pattern + '"';
it(title, function() {
var msg = fixture + (expected ? ' === ' : ' !== ') + pattern;
// assert.equal(mm.isMatch(fixture, pattern), mm.mm.isMatch(fixture, pattern), msg);
assert.equal(mm.isMatch(fixture, pattern), expected, msg);
});
});
});
});
});