Skip to content

Commit

Permalink
FIXUP follow test
Browse files Browse the repository at this point in the history
  • Loading branch information
isaacs committed Mar 6, 2015
1 parent cacb28e commit cabeb27
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions test/follow.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
var glob = require('../')
var test = require('tap').test

process.chdir(__dirname)

test('follow symlinks', function (t) {
var pattern = 'a/symlink/**'
var syncNoFollow = glob.sync(pattern).sort()
var syncFollow = glob.sync(pattern, { follow: true }).sort()
glob(pattern, function (er, res) {
if (er)
throw er
var noFollow = res.sort()
glob(pattern, { follow: true }, function (er, res) {
if (er)
throw er
var follow = res.sort()

t.same(follow, syncFollow, 'sync and async follow should match')
t.same(noFollow, syncNoFollow, 'sync and async noFollow should match')
var long = 'a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c'
t.notEqual(follow.indexOf(long), -1, 'follow should have long entry')
t.notEqual(syncFollow.indexOf(long), -1, 'syncFollow should have long entry')
t.end()
})
})
})

0 comments on commit cabeb27

Please sign in to comment.