1 var tap = require("tap")
3 var origCwd = process.cwd()
4 process.chdir(__dirname)
6 tap.test("changing root and searching for /b*/**", function (t) {
7 var glob = require('../')
8 var path = require('path')
9 t.test('.', function (t) {
10 glob('/b*/**', { globDebug: true, root: '.', nomount: true }, function (er, matches) {
17 t.test('a', function (t) {
18 glob('/b*/**', { globDebug: true, root: path.resolve('a'), nomount: true }, function (er, matches) {
20 t.like(matches, [ '/b', '/b/c', '/b/c/d', '/bc', '/bc/e', '/bc/e/f' ])
25 t.test('root=a, cwd=a/b', function (t) {
26 glob('/b*/**', { globDebug: true, root: 'a', cwd: path.resolve('a/b'), nomount: true }, function (er, matches) {
28 t.like(matches, [ '/b', '/b/c', '/b/c/d', '/bc', '/bc/e', '/bc/e/f' ])
33 t.test('cd -', function (t) {
34 process.chdir(origCwd)