diff options
author | lakatostamas <mail.tamaslakatos@gmail.com> | 2018-11-22 14:27:39 +0100 |
---|---|---|
committer | James M Snell <jasnell@gmail.com> | 2018-11-30 13:12:43 -0800 |
commit | 13920ef41d2784b42f23603633bc04ab46ec32ca (patch) | |
tree | d4008b1ea0f6688012444fb2bde98773c6770ba1 /test/parallel/test-path-makelong.js | |
parent | 36f483b79b56db9da62c15db4bb3293032ac2073 (diff) | |
download | android-node-v8-13920ef41d2784b42f23603633bc04ab46ec32ca.tar.gz android-node-v8-13920ef41d2784b42f23603633bc04ab46ec32ca.tar.bz2 android-node-v8-13920ef41d2784b42f23603633bc04ab46ec32ca.zip |
test: cover path empty string case
In path.toNamespacePath was a case when the path
was empty string and it wasn't covered in the tests.
I covered this case both in Windows and Unix environments.
PR-URL: https://github.com/nodejs/node/pull/24569
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'test/parallel/test-path-makelong.js')
-rw-r--r-- | test/parallel/test-path-makelong.js | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/test/parallel/test-path-makelong.js b/test/parallel/test-path-makelong.js index 01c81b4750..b0a4ebc6b3 100644 --- a/test/parallel/test-path-makelong.js +++ b/test/parallel/test-path-makelong.js @@ -43,6 +43,7 @@ if (common.isWindows) { '\\\\.\\pipe\\somepipe'); } +assert.strictEqual(path.toNamespacedPath(''), ''); assert.strictEqual(path.toNamespacedPath(null), null); assert.strictEqual(path.toNamespacedPath(100), 100); assert.strictEqual(path.toNamespacedPath(path), path); @@ -60,6 +61,7 @@ assert.strictEqual(path.posix.toNamespacedPath(emptyObj), emptyObj); if (common.isWindows) { // These tests cause resolve() to insert the cwd, so we cannot test them from // non-Windows platforms (easily) + assert.strictEqual(path.toNamespacedPath(''), ''); assert.strictEqual(path.win32.toNamespacedPath('foo\\bar').toLowerCase(), `\\\\?\\${process.cwd().toLowerCase()}\\foo\\bar`); assert.strictEqual(path.win32.toNamespacedPath('foo/bar').toLowerCase(), |