Skip to content

Commit

Permalink
test: add more path.basename() tests
Browse files Browse the repository at this point in the history
PR-URL: #6590
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Evan Lucas <[email protected]>
  • Loading branch information
mscdex authored and rvagg committed Jun 2, 2016
1 parent 1469b98 commit 528ca04
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions test/parallel/test-path.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,17 @@ assert.equal(path.basename('aaa/bbb', 'bbb'), 'bbb');
assert.equal(path.basename('aaa/bbb//', 'bbb'), 'bbb');
assert.equal(path.basename('aaa/bbb', 'bb'), 'b');
assert.equal(path.basename('aaa/bbb', 'b'), 'bb');
assert.equal(path.basename('/aaa/bbb', '/bbb'), 'bbb');
assert.equal(path.basename('/aaa/bbb', 'a/bbb'), 'bbb');
assert.equal(path.basename('/aaa/bbb', 'bbb'), 'bbb');
assert.equal(path.basename('/aaa/bbb//', 'bbb'), 'bbb');
assert.equal(path.basename('/aaa/bbb', 'bb'), 'b');
assert.equal(path.basename('/aaa/bbb', 'b'), 'bb');
assert.equal(path.basename('/aaa/bbb'), 'bbb');
assert.equal(path.basename('/aaa/'), 'aaa');
assert.equal(path.basename('/aaa/b'), 'b');
assert.equal(path.basename('/a/b'), 'b');
assert.equal(path.basename('//a'), 'a');

// On Windows a backslash acts as a path separator.
assert.equal(path.win32.basename('\\dir\\basename.ext'), 'basename.ext');
Expand Down

0 comments on commit 528ca04

Please sign in to comment.