Skip to content

Commit

Permalink
test: ensure win32.isAbsolute() is consistent
Browse files Browse the repository at this point in the history
Adds test cases to ensure win32.isAbsolute is consistent.

This is a backport from 3072546

ref: nodejs#6028
  • Loading branch information
mscdex authored and Myles Borins committed Apr 4, 2016
1 parent 4f683ab commit 809f930
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions test/parallel/test-path.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 809f930

Please sign in to comment.