| 1 |
'use strict'; |
| 2 |
|
| 3 |
var f = 'C:\\foo\\test\\posix\\test-path.js'; |
| 4 |
|
| 5 |
module.exports = exports = function (t, a) { exports.tests(t, a); }; |
| 6 |
|
| 7 |
exports.tests = function (t, a) { |
| 8 |
a(t(f).substr(-10), 'test\\posix'); |
| 9 |
a(t('/a/b/'), '/a'); |
| 10 |
a(t('/a/b'), '/a'); |
| 11 |
a(t('/a'), '/'); |
| 12 |
a(t(''), '.'); |
| 13 |
a(t('/'), '/'); |
| 14 |
a(t('////'), '/'); |
| 15 |
|
| 16 |
a(t('c:\\'), 'c:\\'); |
| 17 |
a(t('c:\\foo'), 'c:\\'); |
| 18 |
a(t('c:\\foo\\'), 'c:\\'); |
| 19 |
a(t('c:\\foo\\bar'), 'c:\\foo'); |
| 20 |
a(t('c:\\foo\\bar\\'), 'c:\\foo'); |
| 21 |
a(t('c:\\foo\\bar\\baz'), 'c:\\foo\\bar'); |
| 22 |
a(t('\\'), '\\'); |
| 23 |
a(t('\\foo'), '\\'); |
| 24 |
a(t('\\foo\\'), '\\'); |
| 25 |
a(t('\\foo\\bar'), '\\foo'); |
| 26 |
a(t('\\foo\\bar\\'), '\\foo'); |
| 27 |
a(t('\\foo\\bar\\baz'), '\\foo\\bar'); |
| 28 |
a(t('c:'), 'c:'); |
| 29 |
a(t('c:foo'), 'c:'); |
| 30 |
a(t('c:foo\\'), 'c:'); |
| 31 |
a(t('c:foo\\bar'), 'c:foo'); |
| 32 |
a(t('c:foo\\bar\\'), 'c:foo'); |
| 33 |
a(t('c:foo\\bar\\baz'), 'c:foo\\bar'); |
| 34 |
a(t('\\\\unc\\share'), '\\\\unc\\share'); |
| 35 |
a(t('\\\\unc\\share\\foo'), '\\\\unc\\share\\'); |
| 36 |
a(t('\\\\unc\\share\\foo\\'), '\\\\unc\\share\\'); |
| 37 |
a(t('\\\\unc\\share\\foo\\bar'), |
| 38 |
'\\\\unc\\share\\foo'); |
| 39 |
a(t('\\\\unc\\share\\foo\\bar\\'), |
| 40 |
'\\\\unc\\share\\foo'); |
| 41 |
a(t('\\\\unc\\share\\foo\\bar\\baz'), |
| 42 |
'\\\\unc\\share\\foo\\bar'); |
| 43 |
}; |