3
var origCwd = process.cwd()
4
process.chdir(__dirname)
6
var glob = require('../')
7
var path = require('path')
9
t.test('.', function (t) {
10
glob('/b*/**', { globDebug: true, root: '.' }, function (er, matches) {
18
t.test('a', function (t) {
19
console.error("root=" + path.resolve('a'))
20
glob('/b*/**', { globDebug: true, root: path.resolve('a') }, function (er, matches) {
23
'/b', '/b/c', '/b/c/d', '/bc', '/bc/e', '/bc/e/f'
25
return path.join(path.resolve('a'), m).replace(/\\/g, '/')
28
t.like(matches, wanted)
33
t.test('root=a, cwd=a/b', function (t) {
34
glob('/b*/**', { globDebug: true, root: 'a', cwd: path.resolve('a/b') }, function (er, matches) {
36
t.like(matches, [ '/b', '/b/c', '/b/c/d', '/bc', '/bc/e', '/bc/e/f' ].map(function (m) {
37
return path.join(path.resolve('a'), m).replace(/\\/g, '/')
43
t.test('cd -', function (t) {
44
process.chdir(origCwd)