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

Refs: #6028
PR-URL: #6043
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Brian White <[email protected]>
Reviewed-By: Roman Reiss <[email protected]>
  • Loading branch information
mscdex authored and jasnell committed Apr 8, 2016
1 parent 4f683ab commit ea83c38
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 ea83c38

Please sign in to comment.