Skip to content

Commit

Permalink
test: add test cases for path
Browse files Browse the repository at this point in the history
Add test cases for the following line.
https://github.com/nodejs/node/blob/0f2f8ef/lib/path.js#L1364
https://github.com/nodejs/node/blob/0f2f8ef/lib/path.js#L1347

PR-URL: #11453
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
  • Loading branch information
hiroppy authored and addaleax committed Feb 22, 2017
1 parent a523482 commit c37e2b7
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions test/parallel/test-path.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ const failures = [];
// path.basename tests
assert.strictEqual(path.basename(f), 'test-path.js');
assert.strictEqual(path.basename(f, '.js'), 'test-path');
assert.strictEqual(path.basename('.js', '.js'), '');
assert.strictEqual(path.basename(''), '');
assert.strictEqual(path.basename('/dir/basename.ext'), 'basename.ext');
assert.strictEqual(path.basename('/basename.ext'), 'basename.ext');
Expand Down Expand Up @@ -74,6 +75,7 @@ assert.strictEqual(path.posix.dirname('/a'), '/');
assert.strictEqual(path.posix.dirname(''), '.');
assert.strictEqual(path.posix.dirname('/'), '/');
assert.strictEqual(path.posix.dirname('////'), '/');
assert.strictEqual(path.posix.dirname('//a'), '//');
assert.strictEqual(path.posix.dirname('foo'), '.');

assert.strictEqual(path.win32.dirname('c:\\'), 'c:\\');
Expand Down

0 comments on commit c37e2b7

Please sign in to comment.