globstar-match.js 503 B

12345678910111213141516171819
  1. var Glob = require("../glob.js").Glob
  2. var test = require('tap').test
  3. test('globstar should not have dupe matches', function(t) {
  4. var pattern = 'a/**/[gh]'
  5. var g = new Glob(pattern, { cwd: __dirname })
  6. var matches = []
  7. g.on('match', function(m) {
  8. console.error('match %j', m)
  9. matches.push(m)
  10. })
  11. g.on('end', function(set) {
  12. console.error('set', set)
  13. matches = matches.sort()
  14. set = set.sort()
  15. t.same(matches, set, 'should have same set of matches')
  16. t.end()
  17. })
  18. })