|
| 1 | +'use strict'; |
| 2 | +var tape = require('tape'); |
| 3 | +var path = require('../'); |
| 4 | + |
| 5 | +tape('path.win32.isAbsolute', { skip: true }, function (t) { |
| 6 | + t.strictEqual(path.win32.isAbsolute('/'), true); |
| 7 | + t.strictEqual(path.win32.isAbsolute('//'), true); |
| 8 | + t.strictEqual(path.win32.isAbsolute('//server'), true); |
| 9 | + t.strictEqual(path.win32.isAbsolute('//server/file'), true); |
| 10 | + t.strictEqual(path.win32.isAbsolute('\\\\server\\file'), true); |
| 11 | + t.strictEqual(path.win32.isAbsolute('\\\\server'), true); |
| 12 | + t.strictEqual(path.win32.isAbsolute('\\\\'), true); |
| 13 | + t.strictEqual(path.win32.isAbsolute('c'), false); |
| 14 | + t.strictEqual(path.win32.isAbsolute('c:'), false); |
| 15 | + t.strictEqual(path.win32.isAbsolute('c:\\'), true); |
| 16 | + t.strictEqual(path.win32.isAbsolute('c:/'), true); |
| 17 | + t.strictEqual(path.win32.isAbsolute('c://'), true); |
| 18 | + t.strictEqual(path.win32.isAbsolute('C:/Users/'), true); |
| 19 | + t.strictEqual(path.win32.isAbsolute('C:\\Users\\'), true); |
| 20 | + t.strictEqual(path.win32.isAbsolute('C:cwd/another'), false); |
| 21 | + t.strictEqual(path.win32.isAbsolute('C:cwd\\another'), false); |
| 22 | + t.strictEqual(path.win32.isAbsolute('directory/directory'), false); |
| 23 | + t.strictEqual(path.win32.isAbsolute('directory\\directory'), false); |
| 24 | + t.end(); |
| 25 | +}); |
| 26 | + |
| 27 | +tape('path.posix.isAbsolute', function (t) { |
| 28 | + t.strictEqual(path.posix.isAbsolute('/home/foo'), true); |
| 29 | + t.strictEqual(path.posix.isAbsolute('/home/foo/..'), true); |
| 30 | + t.strictEqual(path.posix.isAbsolute('bar/'), false); |
| 31 | + t.strictEqual(path.posix.isAbsolute('./baz'), false); |
| 32 | + t.end(); |
| 33 | +}); |
0 commit comments