Skip to content

Commit c37e2b7

Browse files
hiroppyaddaleax
authored andcommitted
test: add test cases for path
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>
1 parent a523482 commit c37e2b7

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

test/parallel/test-path.js

+2
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ const failures = [];
1010
// path.basename tests
1111
assert.strictEqual(path.basename(f), 'test-path.js');
1212
assert.strictEqual(path.basename(f, '.js'), 'test-path');
13+
assert.strictEqual(path.basename('.js', '.js'), '');
1314
assert.strictEqual(path.basename(''), '');
1415
assert.strictEqual(path.basename('/dir/basename.ext'), 'basename.ext');
1516
assert.strictEqual(path.basename('/basename.ext'), 'basename.ext');
@@ -74,6 +75,7 @@ assert.strictEqual(path.posix.dirname('/a'), '/');
7475
assert.strictEqual(path.posix.dirname(''), '.');
7576
assert.strictEqual(path.posix.dirname('/'), '/');
7677
assert.strictEqual(path.posix.dirname('////'), '/');
78+
assert.strictEqual(path.posix.dirname('//a'), '//');
7779
assert.strictEqual(path.posix.dirname('foo'), '.');
7880

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

0 commit comments

Comments
 (0)