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: https://github.com/nodejs/node/pull/11453 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
This commit is contained in:
parent
02acea92d2
commit
e18ebe8354
@ -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');
|
||||
@ -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:\\');
|
||||
|
Loading…
x
Reference in New Issue
Block a user