From 34444580f6bb6b68464e8b19f3140e14049fba5d Mon Sep 17 00:00:00 2001 From: Yuta Hiroto Date: Sat, 18 Feb 2017 15:53:01 +0900 Subject: [PATCH] test: add test cases for path MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Reviewed-By: Colin Ihrig Reviewed-By: James M Snell --- test/parallel/test-path.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/parallel/test-path.js b/test/parallel/test-path.js index 0a12b5ce92ca75..88f247c8df493a 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:\\');