summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorBrian White <mscdex@mscdex.net>2016-04-03 08:37:04 -0400
committerJames M Snell <jasnell@gmail.com>2016-04-04 14:45:22 -0700
commit3072546feb9d7f78f12d75bec28ef00e5958f7be (patch)
treee75ef6b51a1178310db60dda0140560cbad0af37 /test
parent68bd7020e1a90e9b3e7bc7b3d78d4fceeb372271 (diff)
downloadandroid-node-v8-3072546feb9d7f78f12d75bec28ef00e5958f7be.tar.gz
android-node-v8-3072546feb9d7f78f12d75bec28ef00e5958f7be.tar.bz2
android-node-v8-3072546feb9d7f78f12d75bec28ef00e5958f7be.zip
path: fix win32.isAbsolute() inconsistency
This commit fixes an inconsistency in absolute path checking compared to the absolute path detection used by the other path.win32 functions. Fixes: https://github.com/nodejs/node/issues/6027 PR-URL: https://github.com/nodejs/node/pull/6028 Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'test')
-rw-r--r--test/parallel/test-path.js10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/parallel/test-path.js b/test/parallel/test-path.js
index 4d0628a4c3..267b0ac14d 100644
--- a/test/parallel/test-path.js
+++ b/test/parallel/test-path.js
@@ -442,8 +442,18 @@ assert.equal(failures.length, 0, failures.join(''));
// path.isAbsolute tests
+assert.equal(path.win32.isAbsolute('/'), true);
+assert.equal(path.win32.isAbsolute('//'), true);
+assert.equal(path.win32.isAbsolute('//server'), true);
assert.equal(path.win32.isAbsolute('//server/file'), true);
assert.equal(path.win32.isAbsolute('\\\\server\\file'), true);
+assert.equal(path.win32.isAbsolute('\\\\server'), true);
+assert.equal(path.win32.isAbsolute('\\\\'), true);
+assert.equal(path.win32.isAbsolute('c'), false);
+assert.equal(path.win32.isAbsolute('c:'), false);
+assert.equal(path.win32.isAbsolute('c:\\'), true);
+assert.equal(path.win32.isAbsolute('c:/'), true);
+assert.equal(path.win32.isAbsolute('c://'), true);
assert.equal(path.win32.isAbsolute('C:/Users/'), true);
assert.equal(path.win32.isAbsolute('C:\\Users\\'), true);
assert.equal(path.win32.isAbsolute('C:cwd/another'), false);