1 var test = require("tap").test
2 var glob = require('../')
3 process.chdir(__dirname)
5 // expose timing issues
7 glob.Glob.prototype._stat = function(o) { return function(f, cb) {
9 setTimeout(function() {
11 }.bind(this), lag += 5)
12 }}(glob.Glob.prototype._stat)
15 test("mark, with **", function (t) {
16 glob("a/*b*/**", {mark: true}, function (er, results) {
36 t.same(results, expect)
41 test("mark, no / on pattern", function (t) {
42 glob("a/*", {mark: true}, function (er, results) {
45 var expect = [ 'a/abcdef/',
52 if (process.platform !== "win32")
53 expect.push('a/symlink/')
55 t.same(results, expect)
57 }).on('match', function(m) {
62 test("mark=false, no / on pattern", function (t) {
63 glob("a/*", function (er, results) {
66 var expect = [ 'a/abcdef',
73 if (process.platform !== "win32")
74 expect.push('a/symlink')
75 t.same(results, expect)
77 }).on('match', function(m) {
78 t.similar(m, /[^\/]$/)
82 test("mark=true, / on pattern", function (t) {
83 glob("a/*/", {mark: true}, function (er, results) {
86 var expect = [ 'a/abcdef/',
92 if (process.platform !== "win32")
93 expect.push('a/symlink/')
94 t.same(results, expect)
96 }).on('match', function(m) {
101 test("mark=false, / on pattern", function (t) {
102 glob("a/*/", function (er, results) {
105 var expect = [ 'a/abcdef/',
111 if (process.platform !== "win32")
112 expect.push('a/symlink/')
113 t.same(results, expect)
115 }).on('match', function(m) {