Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Adding options.maxDepth unit tests.

  • Loading branch information...
commit cd518111a4265e1237405e24de9dc89d4361b38a 1 parent 3d011ef
Ben Alman authored
Showing with 8 additions and 0 deletions.
  1. +8 −0 test/glob_test.js
8 test/glob_test.js
View
@@ -97,5 +97,13 @@ exports['globsync'] = {
test.deepEqual(globsync.glob('*', {cwd: 'test/fixture'}), relFileList([0,1]), '* should match');
test.deepEqual(globsync.glob('*/', {cwd: 'test/fixture'}), relFileList([1]), '* should match');
test.done();
+ },
+ 'options.maxDepth': function(test) {
+ test.expect(4);
+ test.deepEqual(globsync.glob('test/fixture/**', {maxDepth: 1}), fileList([0,1]), 'maxDepth should limit search');
+ test.deepEqual(globsync.glob('test/fixture/**', {maxDepth: 2}), fileList([0,1,2,6]), 'maxDepth should limit search');
+ test.deepEqual(globsync.glob('**', {cwd: 'test/fixture', maxDepth: 1}), relFileList([0,1]), 'maxDepth should limit search');
+ test.deepEqual(globsync.glob('**', {cwd: 'test/fixture', maxDepth: 2}), relFileList([0,1,2,6]), 'maxDepth should limit search');
+ test.done();
}
};
Please sign in to comment.
Something went wrong with that request. Please try again.