diff options
author | Yuta Hiroto <git@about-hiroppy.com> | 2017-02-18 15:53:01 +0900 |
---|---|---|
committer | James M Snell <jasnell@gmail.com> | 2017-02-19 12:40:57 -0800 |
commit | e18ebe8354b600ca868bb3abd65d8a159e190d17 (patch) | |
tree | dba47854c4f0577e65f0991718feeb540024331a /test | |
parent | 02acea92d22217e11b9eb59abf9ff261a56d1a9e (diff) | |
download | node-new-e18ebe8354b600ca868bb3abd65d8a159e190d17.tar.gz |
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>
Diffstat (limited to 'test')
-rw-r--r-- | test/parallel/test-path.js | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/test/parallel/test-path.js b/test/parallel/test-path.js index 42a54b1707..3c5374175a 100644 --- a/test/parallel/test-path.js +++ b/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:\\'); |