From 809f930bea71a823829306acc2787d27f1e33351 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 ref: https://github.com/nodejs/node/pull/6028 --- 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);