GeezerVison is showing github.com — test: cover path empty string case · nodejs/node@288a421
File tree
Expand file treeCollapse file tree
Open diff view settings
Expand file treeCollapse file tree
Open diff view settings
Collapse file
Copy file name to clipboardExpand all lines: test/parallel/test-path-makelong.js +2Lines changed: 2 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -43,6 +43,7 @@ if (common.isWindows) { |
43 | 43 | '\\\\.\\pipe\\somepipe'); |
44 | 44 | } |
45 | 45 |
|
| 46 | +assert.strictEqual(path.toNamespacedPath(''), ''); |
46 | 47 | assert.strictEqual(path.toNamespacedPath(null), null); |
47 | 48 | assert.strictEqual(path.toNamespacedPath(100), 100); |
48 | 49 | assert.strictEqual(path.toNamespacedPath(path), path); |
@@ -60,6 +61,7 @@ assert.strictEqual(path.posix.toNamespacedPath(emptyObj), emptyObj); |
60 | 61 | if (common.isWindows) { |
61 | 62 | // These tests cause resolve() to insert the cwd, so we cannot test them from |
62 | 63 | // non-Windows platforms (easily) |
| 64 | + assert.strictEqual(path.toNamespacedPath(''), ''); |
63 | 65 | assert.strictEqual(path.win32.toNamespacedPath('foo\\bar').toLowerCase(), |
64 | 66 | `\\\\?\\${process.cwd().toLowerCase()}\\foo\\bar`); |
65 | 67 | assert.strictEqual(path.win32.toNamespacedPath('foo/bar').toLowerCase(), |
|