From ea83c382f9954cc0ec12180d8e49c356fa034e16 Mon Sep 17 00:00:00 2001 From: Brian White Date: Sun, 3 Apr 2016 08:37:04 -0400 Subject: [PATCH] test: ensure win32.isAbsolute() is consistent Adds test cases to ensure win32.isAbsolute is consistent. This is a backport from 3072546feb Refs: https://github.com/nodejs/node/pull/6028 PR-URL: https://github.com/nodejs/node/pull/6043 Reviewed-By: James M Snell Reviewed-By: Brian White Reviewed-By: Roman Reiss --- test/parallel/test-path.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/test/parallel/test-path.js b/test/parallel/test-path.js index e8c282053550cf..1432cb63a10ae4 100644 --- a/test/parallel/test-path.js +++ b/test/parallel/test-path.js @@ -344,8 +344,18 @@ resolveTests.forEach(function(test) { 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);