Skip to content

Commit 809f930

Browse files
mscdexMyles Borins
authored and
Myles Borins
committedApr 4, 2016
test: ensure win32.isAbsolute() is consistent
Adds test cases to ensure win32.isAbsolute is consistent. This is a backport from 3072546 ref: nodejs#6028
1 parent 4f683ab commit 809f930

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed
 

‎test/parallel/test-path.js

+10
Original file line numberDiff line numberDiff line change
@@ -344,8 +344,18 @@ resolveTests.forEach(function(test) {
344344
assert.equal(failures.length, 0, failures.join(''));
345345

346346
// path.isAbsolute tests
347+
assert.equal(path.win32.isAbsolute('/'), true);
348+
assert.equal(path.win32.isAbsolute('//'), true);
349+
assert.equal(path.win32.isAbsolute('//server'), true);
347350
assert.equal(path.win32.isAbsolute('//server/file'), true);
348351
assert.equal(path.win32.isAbsolute('\\\\server\\file'), true);
352+
assert.equal(path.win32.isAbsolute('\\\\server'), true);
353+
assert.equal(path.win32.isAbsolute('\\\\'), true);
354+
assert.equal(path.win32.isAbsolute('c'), false);
355+
assert.equal(path.win32.isAbsolute('c:'), false);
356+
assert.equal(path.win32.isAbsolute('c:\\'), true);
357+
assert.equal(path.win32.isAbsolute('c:/'), true);
358+
assert.equal(path.win32.isAbsolute('c://'), true);
349359
assert.equal(path.win32.isAbsolute('C:/Users/'), true);
350360
assert.equal(path.win32.isAbsolute('C:\\Users\\'), true);
351361
assert.equal(path.win32.isAbsolute('C:cwd/another'), false);

0 commit comments

Comments
 (0)