Browse Source

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 <jasnell@gmail.com>
Reviewed-By: Brian White <mscdex@mscdex.net>
Reviewed-By: Roman Reiss <me@silverwind.io>
v4.x
Brian White 9 years ago
committed by James M Snell
parent
commit
ea83c382f9
  1. 10
      test/parallel/test-path.js

10
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);

Loading…
Cancel
Save