Browse Source

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>
v6.x
Yuta Hiroto 8 years ago
committed by Myles Borins
parent
commit
34444580f6
No known key found for this signature in database GPG Key ID: 933B01F40B5CA946
  1. 2
      test/parallel/test-path.js

2
test/parallel/test-path.js

@ -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…
Cancel
Save