From c38952610e218f77776f169e3d00f79544f3d7e5 Mon Sep 17 00:00:00 2001 From: PaulBags <19583196+PaulBags@users.noreply.github.com> Date: Tue, 23 Jul 2019 21:04:18 +1200 Subject: [PATCH] test: add tests for spaces in folder names Add tests for spaces in folder names for path.win32.dirname(). PR-URL: https://github.com/nodejs/node/pull/28819 Reviewed-By: Rich Trott --- test/parallel/test-path-dirname.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/test/parallel/test-path-dirname.js b/test/parallel/test-path-dirname.js index 6ecb5c93b4db74..d085cecb24f069 100644 --- a/test/parallel/test-path-dirname.js +++ b/test/parallel/test-path-dirname.js @@ -21,18 +21,21 @@ assert.strictEqual(path.win32.dirname('c:\\foo\\'), 'c:\\'); assert.strictEqual(path.win32.dirname('c:\\foo\\bar'), 'c:\\foo'); assert.strictEqual(path.win32.dirname('c:\\foo\\bar\\'), 'c:\\foo'); assert.strictEqual(path.win32.dirname('c:\\foo\\bar\\baz'), 'c:\\foo\\bar'); +assert.strictEqual(path.win32.dirname('c:\\foo bar\\baz'), 'c:\\foo bar'); assert.strictEqual(path.win32.dirname('\\'), '\\'); assert.strictEqual(path.win32.dirname('\\foo'), '\\'); assert.strictEqual(path.win32.dirname('\\foo\\'), '\\'); assert.strictEqual(path.win32.dirname('\\foo\\bar'), '\\foo'); assert.strictEqual(path.win32.dirname('\\foo\\bar\\'), '\\foo'); assert.strictEqual(path.win32.dirname('\\foo\\bar\\baz'), '\\foo\\bar'); +assert.strictEqual(path.win32.dirname('\\foo bar\\baz'), '\\foo bar'); assert.strictEqual(path.win32.dirname('c:'), 'c:'); assert.strictEqual(path.win32.dirname('c:foo'), 'c:'); assert.strictEqual(path.win32.dirname('c:foo\\'), 'c:'); assert.strictEqual(path.win32.dirname('c:foo\\bar'), 'c:foo'); assert.strictEqual(path.win32.dirname('c:foo\\bar\\'), 'c:foo'); assert.strictEqual(path.win32.dirname('c:foo\\bar\\baz'), 'c:foo\\bar'); +assert.strictEqual(path.win32.dirname('c:foo bar\\baz'), 'c:foo bar'); assert.strictEqual(path.win32.dirname('file:stream'), '.'); assert.strictEqual(path.win32.dirname('dir\\file:stream'), 'dir'); assert.strictEqual(path.win32.dirname('\\\\unc\\share'),