Lines Matching refs:assert
127 else static assert(0, "unsupported platform");
137 else static assert(0, "unsupported platform");
203 in { assert(isUNC(path)); } in version()
265 assert(ltrimDirSeparators("//abc//").array == "abc//");
266 assert(ltrimDirSeparators("//abc//"d).array == "abc//"d);
267 assert(ltrimDirSeparators("//abc//".byDchar).array == "abc//"d);
294 assert(rtrimDirSeparators("//abc//").array == "//abc");
295 assert(rtrimDirSeparators("//abc//"d).array == "//abc"d);
297 assert(rtrimDirSeparators(MockBiRange!char("//abc//")).array == "//abc");
312 assert(trimDirSeparators("//abc//").array == "abc");
313 assert(trimDirSeparators("//abc//"d).array == "abc"d);
315 assert(trimDirSeparators(MockBiRange!char("//abc//")).array == "abc");
342 else static assert(0);
444 assert(baseName("").empty);
445 assert(baseName("file.ext"w) == "file.ext");
446 assert(baseName("file.ext"d, ".ext") == "file");
447 assert(baseName("file", "file"w.dup) == "file");
448 assert(baseName("dir/file.ext"d.dup) == "file.ext");
449 assert(baseName("dir/file.ext", ".ext"d) == "file");
450 assert(baseName("dir/file"w, "file"d) == "file");
451 assert(baseName("dir///subdir////") == "subdir");
452 assert(baseName("dir/subdir.ext/", ".ext") == "subdir");
453 assert(baseName("dir/subdir/".dup, "subdir") == "subdir");
454 assert(baseName("/"w.dup) == "/");
455 assert(baseName("//"d.dup) == "/");
456 assert(baseName("///") == "/");
458 assert(baseName!(CaseSensitive.yes)("file.ext", ".EXT") == "file.ext");
459 assert(baseName!(CaseSensitive.no)("file.ext", ".EXT") == "file");
465 assert(s[i] == c);
470 assert(baseName(`dir\file.ext`) == `file.ext`); in version()
471 assert(baseName(`dir\file.ext`, `.ext`) == `file`); in version()
472 assert(baseName(`dir\file`, `file`) == `file`); in version()
473 assert(baseName(`d:file.ext`) == `file.ext`); in version()
474 assert(baseName(`d:file.ext`, `.ext`) == `file`); in version()
475 assert(baseName(`d:file`, `file`) == `file`); in version()
476 assert(baseName(`dir\\subdir\\\`) == `subdir`); in version()
477 assert(baseName(`dir\subdir.ext\`, `.ext`) == `subdir`); in version()
478 assert(baseName(`dir\subdir\`, `subdir`) == `subdir`); in version()
479 assert(baseName(`\`) == `\`); in version()
480 assert(baseName(`\\`) == `\`); in version()
481 assert(baseName(`\\\`) == `\`); in version()
482 assert(baseName(`d:\`) == `\`); in version()
483 assert(baseName(`d:`).empty); in version()
484 assert(baseName(`\\server\share\file`) == `file`); in version()
485 assert(baseName(`\\server\share\`) == `\`); in version()
486 assert(baseName(`\\server\share`) == `\`); in version()
491 assert(s[i] == c); in version()
494 assert(baseName(stripExtension("dir/file.ext")) == "file");
496 static assert(baseName("dir/file.ext") == "file.ext");
497 static assert(baseName("dir/file.ext", ".ext") == "file");
500 assert(baseName(DirEntry("dir/file.ext")) == "file.ext");
505 assert(testAliasedString!baseName("file"));
508 assert(S.a.baseName == "test");
511 assert(sa.baseName == "test");
593 assert(dirName("") == ".");
594 assert(dirName("file"w) == ".");
595 assert(dirName("dir/"d) == ".");
596 assert(dirName("dir///") == ".");
597 assert(dirName("dir/file"w.dup) == "dir");
598 assert(dirName("dir///file"d.dup) == "dir");
599 assert(dirName("dir/subdir/") == "dir");
600 assert(dirName("/dir/file"w) == "/dir");
601 assert(dirName("/file"d) == "/");
602 assert(dirName("/") == "/");
603 assert(dirName("///") == "/");
607 assert(dirName(`dir\`) == `.`); in version()
608 assert(dirName(`dir\\\`) == `.`); in version()
609 assert(dirName(`dir\file`) == `dir`); in version()
610 assert(dirName(`dir\\\file`) == `dir`); in version()
611 assert(dirName(`dir\subdir\`) == `dir`); in version()
612 assert(dirName(`\dir\file`) == `\dir`); in version()
613 assert(dirName(`\file`) == `\`); in version()
614 assert(dirName(`\`) == `\`); in version()
615 assert(dirName(`\\\`) == `\`); in version()
616 assert(dirName(`d:`) == `d:`); in version()
617 assert(dirName(`d:file`) == `d:`); in version()
618 assert(dirName(`d:\`) == `d:\`); in version()
619 assert(dirName(`d:\file`) == `d:\`); in version()
620 assert(dirName(`d:\dir\file`) == `d:\dir`); in version()
621 assert(dirName(`\\server\share\dir\file`) == `\\server\share\dir`); in version()
622 assert(dirName(`\\server\share\file`) == `\\server\share`); in version()
623 assert(dirName(`\\server\share\`) == `\\server\share`); in version()
624 assert(dirName(`\\server\share`) == `\\server\share`); in version()
630 assert(testAliasedString!dirName("file"));
633 assert(S.a.dirName == "file/path/to");
636 assert(sa.dirName == "file/path/to");
641 static assert(dirName("dir/file") == "dir");
646 assert(dirName("".byChar).array == ".");
647 assert(dirName("file"w.byWchar).array == "."w);
648 assert(dirName("dir/"d.byDchar).array == "."d);
649 assert(dirName("dir///".byChar).array == ".");
650 assert(dirName("dir/subdir/".byChar).array == "dir");
651 assert(dirName("/dir/file"w.byWchar).array == "/dir"w);
652 assert(dirName("/file"d.byDchar).array == "/"d);
653 assert(dirName("/".byChar).array == "/");
654 assert(dirName("///".byChar).array == "/");
658 assert(dirName(`dir\`.byChar).array == `.`); in version()
659 assert(dirName(`dir\\\`.byChar).array == `.`); in version()
660 assert(dirName(`dir\file`.byChar).array == `dir`); in version()
661 assert(dirName(`dir\\\file`.byChar).array == `dir`); in version()
662 assert(dirName(`dir\subdir\`.byChar).array == `dir`); in version()
663 assert(dirName(`\dir\file`.byChar).array == `\dir`); in version()
664 assert(dirName(`\file`.byChar).array == `\`); in version()
665 assert(dirName(`\`.byChar).array == `\`); in version()
666 assert(dirName(`\\\`.byChar).array == `\`); in version()
667 assert(dirName(`d:`.byChar).array == `d:`); in version()
668 assert(dirName(`d:file`.byChar).array == `d:`); in version()
669 assert(dirName(`d:\`.byChar).array == `d:\`); in version()
670 assert(dirName(`d:\file`.byChar).array == `d:\`); in version()
671 assert(dirName(`d:\dir\file`.byChar).array == `d:\dir`); in version()
672 assert(dirName(`\\server\share\dir\file`.byChar).array == `\\server\share\dir`); in version()
673 assert(dirName(`\\server\share\file`) == `\\server\share`); in version()
674 assert(dirName(`\\server\share\`.byChar).array == `\\server\share`); in version()
675 assert(dirName(`\\server\share`.byChar).array == `\\server\share`); in version()
718 else static assert(0, "unsupported platform");
720 assert(!isRooted(path));
731 assert(rootName("") is null);
732 assert(rootName("foo") is null);
733 assert(rootName("/") == "/");
734 assert(rootName("/foo/bar") == "/");
738 assert(rootName("d:foo") is null); in version()
739 assert(rootName(`d:\foo`) == `d:\`); in version()
740 assert(rootName(`\\server\share\foo`) == `\\server\share`); in version()
741 assert(rootName(`\\server\share`) == `\\server\share`); in version()
747 assert(testAliasedString!rootName("/foo/bar"));
755 assert(rootName("".byChar).array == "");
756 assert(rootName("foo".byChar).array == "");
757 assert(rootName("/".byChar).array == "/");
758 assert(rootName("/foo/bar".byChar).array == "/");
762 assert(rootName("d:foo".byChar).array == ""); in version()
763 assert(rootName(`d:\foo`.byChar).array == `d:\`); in version()
764 assert(rootName(`\\server\share\foo`.byChar).array == `\\server\share`); in version()
765 assert(rootName(`\\server\share`.byChar).array == `\\server\share`); in version()
811 version (Posix) assert(driveName("c:/foo").empty);
814 assert(driveName(`dir\file`).empty); in version()
815 assert(driveName(`d:file`) == "d:"); in version()
816 assert(driveName(`d:\file`) == "d:"); in version()
817 assert(driveName("d:") == "d:"); in version()
818 assert(driveName(`\\server\share\file`) == `\\server\share`); in version()
819 assert(driveName(`\\server\share\`) == `\\server\share`); in version()
820 assert(driveName(`\\server\share`) == `\\server\share`); in version()
822 static assert(driveName(`d:\file`) == "d:"); in version()
834 assert(testAliasedString!driveName(`d:\file`));
842 version (Posix) assert(driveName("c:/foo".byChar).empty);
845 assert(driveName(`dir\file`.byChar).empty); in version()
846 assert(driveName(`d:file`.byChar).array == "d:"); in version()
847 assert(driveName(`d:\file`.byChar).array == "d:"); in version()
848 assert(driveName("d:".byChar).array == "d:"); in version()
849 assert(driveName(`\\server\share\file`.byChar).array == `\\server\share`); in version()
850 assert(driveName(`\\server\share\`.byChar).array == `\\server\share`); in version()
851 assert(driveName(`\\server\share`.byChar).array == `\\server\share`); in version()
853 static assert(driveName(`d:\file`).array == "d:"); in version()
884 assert(stripDrive(`d:\dir\file`) == `\dir\file`); in version()
885 assert(stripDrive(`\\server\share\dir\file`) == `\dir\file`); in version()
897 assert(testAliasedString!stripDrive(`d:\dir\file`));
904 assert(stripDrive(`d:\dir\file`) == `\dir\file`); in version()
905 assert(stripDrive(`\\server\share\dir\file`) == `\dir\file`); in version()
906 static assert(stripDrive(`d:\dir\file`) == `\dir\file`); in version()
911 assert(s[i] == c); in version()
915 assert(stripDrive(`d:\dir\file`) == `d:\dir\file`); in version()
920 assert(s[i] == c); in version()
947 assert(extSeparatorPos("file") == -1);
948 assert(extSeparatorPos("file.ext"w) == 4);
949 assert(extSeparatorPos("file.ext1.ext2"d) == 9);
950 assert(extSeparatorPos(".foo".dup) == -1);
951 assert(extSeparatorPos(".foo.ext"w.dup) == 4);
956 assert(extSeparatorPos("dir/file"d.dup) == -1);
957 assert(extSeparatorPos("dir/file.ext") == 8);
958 assert(extSeparatorPos("dir/file.ext1.ext2"w) == 13);
959 assert(extSeparatorPos("dir/.foo"d) == -1);
960 assert(extSeparatorPos("dir/.foo.ext".dup) == 8);
964 assert(extSeparatorPos("dir\\file") == -1); in version()
965 assert(extSeparatorPos("dir\\file.ext") == 8); in version()
966 assert(extSeparatorPos("dir\\file.ext1.ext2") == 13); in version()
967 assert(extSeparatorPos("dir\\.foo") == -1); in version()
968 assert(extSeparatorPos("dir\\.foo.ext") == 8); in version()
970 assert(extSeparatorPos("d:file") == -1); in version()
971 assert(extSeparatorPos("d:file.ext") == 6); in version()
972 assert(extSeparatorPos("d:file.ext1.ext2") == 11); in version()
973 assert(extSeparatorPos("d:.foo") == -1); in version()
974 assert(extSeparatorPos("d:.foo.ext") == 6); in version()
977 static assert(extSeparatorPos("file") == -1);
978 static assert(extSeparatorPos("file.ext"w) == 4);
1007 assert(extension("file").empty);
1008 assert(extension("file.") == ".");
1009 assert(extension("file.ext"w) == ".ext");
1010 assert(extension("file.ext1.ext2"d) == ".ext2");
1011 assert(extension(".foo".dup).empty);
1012 assert(extension(".foo.ext"w.dup) == ".ext");
1014 static assert(extension("file").empty);
1015 static assert(extension("file.ext") == ".ext");
1024 assert(s[i] == c);
1028 assert(extension(DirEntry("file")).empty);
1052 assert(stripExtension("file") == "file");
1053 assert(stripExtension("file.ext") == "file");
1054 assert(stripExtension("file.ext1.ext2") == "file.ext1");
1055 assert(stripExtension("file.") == "file");
1056 assert(stripExtension(".file") == ".file");
1057 assert(stripExtension(".file.ext") == ".file");
1058 assert(stripExtension("dir/file.ext") == "dir/file");
1069 assert(testAliasedString!stripExtension("file"));
1074 assert(stripExtension("file.ext"w) == "file");
1075 assert(stripExtension("file.ext1.ext2"d) == "file.ext1");
1080 assert(stripExtension("file".byChar).array == "file");
1081 assert(stripExtension("file.ext"w.byWchar).array == "file");
1082 assert(stripExtension("file.ext1.ext2"d.byDchar).array == "file.ext1");
1119 assert(0); in catch()
1137 assert(0); in catch()
1144 assert(setExtension("file", "ext") == "file.ext");
1145 assert(setExtension("file"w, ".ext"w) == "file.ext");
1146 assert(setExtension("file."d, "ext"d) == "file.ext");
1147 assert(setExtension("file.", ".ext") == "file.ext");
1148 assert(setExtension("file.old"w, "new"w) == "file.new");
1149 assert(setExtension("file.old"d, ".new"d) == "file.new");
1154 assert(setExtension("file"w.dup, "ext"w) == "file.ext");
1155 assert(setExtension("file"w.dup, ".ext"w) == "file.ext");
1156 assert(setExtension("file."w, "ext"w.dup) == "file.ext");
1157 assert(setExtension("file."w, ".ext"w.dup) == "file.ext");
1158 assert(setExtension("file.old"d.dup, "new"d) == "file.new");
1159 assert(setExtension("file.old"d.dup, ".new"d) == "file.new");
1161 static assert(setExtension("file", "ext") == "file.ext");
1162 static assert(setExtension("file.old", "new") == "file.new");
1164 static assert(setExtension("file"w.dup, "ext"w) == "file.ext");
1165 static assert(setExtension("file.old"d.dup, "new"d) == "file.new");
1168 assert(setExtension("file", "") == "file");
1169 assert(setExtension("file.ext", "") == "file");
1204 assert(withExtension("file", "ext").array == "file.ext");
1205 assert(withExtension("file"w, ".ext"w).array == "file.ext");
1206 assert(withExtension("file.ext"w, ".").array == "file.");
1209 assert(withExtension("file".byChar, "ext").array == "file.ext");
1210 assert(withExtension("file"w.byWchar, ".ext"w).array == "file.ext"w);
1211 assert(withExtension("file.ext"w.byWchar, ".").array == "file."w);
1222 assert(testAliasedString!withExtension("file", "ext"));
1247 assert(defaultExtension("file", "ext") == "file.ext");
1248 assert(defaultExtension("file", ".ext") == "file.ext");
1249 assert(defaultExtension("file.", "ext") == "file.");
1250 assert(defaultExtension("file.old", "new") == "file.old");
1251 assert(defaultExtension("file.old", ".new") == "file.old");
1256 assert(defaultExtension("file"w.dup, "ext"w) == "file.ext");
1257 assert(defaultExtension("file.old"d.dup, "new"d) == "file.old");
1259 static assert(defaultExtension("file", "ext") == "file.ext");
1260 static assert(defaultExtension("file.old", "new") == "file.old");
1262 static assert(defaultExtension("file"w.dup, "ext"w) == "file.ext");
1263 static assert(defaultExtension("file.old"d.dup, "new"d) == "file.old");
1306 assert(withDefaultExtension("file", "ext").array == "file.ext");
1307 assert(withDefaultExtension("file"w, ".ext").array == "file.ext"w);
1308 assert(withDefaultExtension("file.", "ext").array == "file.");
1309 assert(withDefaultExtension("file", "").array == "file.");
1312 assert(withDefaultExtension("file".byChar, "ext").array == "file.ext");
1313 assert(withDefaultExtension("file"w.byWchar, ".ext").array == "file.ext"w);
1314 assert(withDefaultExtension("file.".byChar, "ext"d).array == "file.");
1315 assert(withDefaultExtension("file".byChar, "").array == "file.");
1326 assert(testAliasedString!withDefaultExtension("file", "ext"));
1404 assert(buildPath("foo", "bar", "baz") == "foo/bar/baz"); in version()
1405 assert(buildPath("/foo/", "bar/baz") == "/foo/bar/baz"); in version()
1406 assert(buildPath("/foo", "/bar") == "/bar"); in version()
1411 assert(buildPath("foo", "bar", "baz") == `foo\bar\baz`); in version()
1412 assert(buildPath(`c:\foo`, `bar\baz`) == `c:\foo\bar\baz`); in version()
1413 assert(buildPath("foo", `d:\bar`) == `d:\bar`); in version()
1414 assert(buildPath("foo", `\bar`) == `\bar`); in version()
1415 assert(buildPath(`c:\foo`, `\bar`) == `c:\bar`); in version()
1427 assert(buildPath("foo") == "foo"); in version()
1428 assert(buildPath("/foo/") == "/foo/"); in version()
1429 assert(buildPath("foo", "bar") == "foo/bar"); in version()
1430 assert(buildPath("foo", "bar", "baz") == "foo/bar/baz"); in version()
1431 assert(buildPath("foo/".dup, "bar") == "foo/bar"); in version()
1432 assert(buildPath("foo///", "bar".dup) == "foo///bar"); in version()
1433 assert(buildPath("/foo"w, "bar"w) == "/foo/bar"); in version()
1434 assert(buildPath("foo"w.dup, "/bar"w) == "/bar"); in version()
1435 assert(buildPath("foo"w, "bar/"w.dup) == "foo/bar/"); in version()
1436 assert(buildPath("/"d, "foo"d) == "/foo"); in version()
1437 assert(buildPath(""d.dup, "foo"d) == "foo"); in version()
1438 assert(buildPath("foo"d, ""d.dup) == "foo"); in version()
1439 assert(buildPath("foo", "bar".dup, "baz") == "foo/bar/baz"); in version()
1440 assert(buildPath("foo"w, "/bar"w, "baz"w.dup) == "/bar/baz"); in version()
1442 static assert(buildPath("foo", "bar", "baz") == "foo/bar/baz"); in version()
1443 static assert(buildPath("foo", "/bar", "baz") == "/bar/baz"); in version()
1447 assert(buildPath(ir("foo")) == "foo"); in version()
1448 assert(buildPath(ir("/foo/")) == "/foo/"); in version()
1449 assert(buildPath(ir("foo", "bar")) == "foo/bar"); in version()
1450 assert(buildPath(ir("foo", "bar", "baz")) == "foo/bar/baz"); in version()
1451 assert(buildPath(ir("foo/".dup, "bar".dup)) == "foo/bar"); in version()
1452 assert(buildPath(ir("foo///".dup, "bar".dup)) == "foo///bar"); in version()
1453 assert(buildPath(ir("/foo"w, "bar"w)) == "/foo/bar"); in version()
1454 assert(buildPath(ir("foo"w.dup, "/bar"w.dup)) == "/bar"); in version()
1455 assert(buildPath(ir("foo"w.dup, "bar/"w.dup)) == "foo/bar/"); in version()
1456 assert(buildPath(ir("/"d, "foo"d)) == "/foo"); in version()
1457 assert(buildPath(ir(""d.dup, "foo"d.dup)) == "foo"); in version()
1458 assert(buildPath(ir("foo"d, ""d)) == "foo"); in version()
1459 assert(buildPath(ir("foo", "bar", "baz")) == "foo/bar/baz"); in version()
1460 assert(buildPath(ir("foo"w.dup, "/bar"w.dup, "baz"w.dup)) == "/bar/baz"); in version()
1464 assert(buildPath("foo") == "foo"); in version()
1465 assert(buildPath(`\foo/`) == `\foo/`); in version()
1466 assert(buildPath("foo", "bar", "baz") == `foo\bar\baz`); in version()
1467 assert(buildPath("foo", `\bar`) == `\bar`); in version()
1468 assert(buildPath(`c:\foo`, "bar") == `c:\foo\bar`); in version()
1469 assert(buildPath("foo"w, `d:\bar`w.dup) == `d:\bar`); in version()
1470 assert(buildPath(`c:\foo\bar`, `\baz`) == `c:\baz`); in version()
1471 assert(buildPath(`\\foo\bar\baz`d, `foo`d, `\bar`d) == `\\foo\bar\bar`d); in version()
1473 static assert(buildPath("foo", "bar", "baz") == `foo\bar\baz`); in version()
1474 static assert(buildPath("foo", `c:\bar`, "baz") == `c:\bar\baz`); in version()
1476 assert(buildPath(ir("foo")) == "foo"); in version()
1477 assert(buildPath(ir(`\foo/`)) == `\foo/`); in version()
1478 assert(buildPath(ir("foo", "bar", "baz")) == `foo\bar\baz`); in version()
1479 assert(buildPath(ir("foo", `\bar`)) == `\bar`); in version()
1480 assert(buildPath(ir(`c:\foo`, "bar")) == `c:\foo\bar`); in version()
1481 assert(buildPath(ir("foo"w.dup, `d:\bar`w.dup)) == `d:\bar`); in version()
1482 assert(buildPath(ir(`c:\foo\bar`, `\baz`)) == `c:\baz`); in version()
1483 assert(buildPath(ir(`\\foo\bar\baz`d, `foo`d, `\bar`d)) == `\\foo\bar\bar`d); in version()
1489 assert(buildPath(manyShort) == manyShortCombined);
1490 assert(buildPath(ir(manyShort)) == manyShortCombined);
1494 assert(buildPath(fewLong) == fewLongCombined);
1495 assert(buildPath(ir(fewLong)) == fewLongCombined);
1504 assert(buildPath(ary) == "a/b"); in version()
1508 assert(buildPath(ary) == `a\b`); in version()
1571 static assert(0);
1589 assert(chainPath("foo", "bar", "baz").array == "foo/bar/baz"); in version()
1590 assert(chainPath("/foo/", "bar/baz").array == "/foo/bar/baz"); in version()
1591 assert(chainPath("/foo", "/bar").array == "/bar"); in version()
1596 assert(chainPath("foo", "bar", "baz").array == `foo\bar\baz`); in version()
1597 assert(chainPath(`c:\foo`, `bar\baz`).array == `c:\foo\bar\baz`); in version()
1598 assert(chainPath("foo", `d:\bar`).array == `d:\bar`); in version()
1599 assert(chainPath("foo", `\bar`).array == `\bar`); in version()
1600 assert(chainPath(`c:\foo`, `\bar`).array == `c:\bar`); in version()
1606 assert(chainPath("foo", "bar", "baz").array == "foo/bar/baz"); in version()
1607 assert(chainPath("/foo/".byChar, "bar/baz").array == "/foo/bar/baz"); in version()
1608 assert(chainPath("/foo", "/bar".byChar).array == "/bar"); in version()
1613 assert(chainPath("foo", "bar", "baz").array == `foo\bar\baz`); in version()
1614 assert(chainPath(`c:\foo`.byChar, `bar\baz`).array == `c:\foo\bar\baz`); in version()
1615 assert(chainPath("foo", `d:\bar`).array == `d:\bar`); in version()
1616 assert(chainPath("foo", `\bar`.byChar).array == `\bar`); in version()
1617 assert(chainPath(`c:\foo`, `\bar`w).array == `c:\bar`); in version()
1632 …assert(chainPath(TestAliasedString(null), TestAliasedString(null), TestAliasedString(null)).empty);
1633 assert(chainPath(TestAliasedString(null), TestAliasedString(null), "").empty);
1634 assert(chainPath(TestAliasedString(null), "", TestAliasedString(null)).empty);
1636 …static assert(!__traits(compiles, chainPath(TestAliasedString(null), S(""), TestAliasedString(null…
1679 assert(buildNormalizedPath("foo", "..") == ".");
1683 assert(buildNormalizedPath("/foo/./bar/..//baz/") == "/foo/baz"); in version()
1684 assert(buildNormalizedPath("../foo/.") == "../foo"); in version()
1685 assert(buildNormalizedPath("/foo", "bar/baz/") == "/foo/bar/baz"); in version()
1686 assert(buildNormalizedPath("/foo", "/bar/..", "baz") == "/baz"); in version()
1687 assert(buildNormalizedPath("foo/./bar", "../../", "../baz") == "../baz"); in version()
1688 assert(buildNormalizedPath("/foo/./bar", "../../baz") == "/baz"); in version()
1693 assert(buildNormalizedPath(`c:\foo\.\bar/..\\baz\`) == `c:\foo\baz`); in version()
1694 assert(buildNormalizedPath(`..\foo\.`) == `..\foo`); in version()
1695 assert(buildNormalizedPath(`c:\foo`, `bar\baz\`) == `c:\foo\bar\baz`); in version()
1696 assert(buildNormalizedPath(`c:\foo`, `bar/..`) == `c:\foo`); in version()
1697 assert(buildNormalizedPath(`\\server\share\foo`, `..\bar`) == in version()
1704 assert(buildNormalizedPath(".", ".") == ".");
1705 assert(buildNormalizedPath("foo", "..") == ".");
1706 assert(buildNormalizedPath("", "") is null);
1707 assert(buildNormalizedPath("", ".") == ".");
1708 assert(buildNormalizedPath(".", "") == ".");
1709 assert(buildNormalizedPath(null, "foo") == "foo");
1710 assert(buildNormalizedPath("", "foo") == "foo");
1711 assert(buildNormalizedPath("", "") == "");
1712 assert(buildNormalizedPath("", null) == "");
1713 assert(buildNormalizedPath(null, "") == "");
1714 assert(buildNormalizedPath!(char)(null, null) == "");
1718 assert(buildNormalizedPath("/", "foo", "bar") == "/foo/bar"); in version()
1719 assert(buildNormalizedPath("foo", "bar", "baz") == "foo/bar/baz"); in version()
1720 assert(buildNormalizedPath("foo", "bar/baz") == "foo/bar/baz"); in version()
1721 assert(buildNormalizedPath("foo", "bar//baz///") == "foo/bar/baz"); in version()
1722 assert(buildNormalizedPath("/foo", "bar/baz") == "/foo/bar/baz"); in version()
1723 assert(buildNormalizedPath("/foo", "/bar/baz") == "/bar/baz"); in version()
1724 assert(buildNormalizedPath("/foo/..", "/bar/./baz") == "/bar/baz"); in version()
1725 assert(buildNormalizedPath("/foo/..", "bar/baz") == "/bar/baz"); in version()
1726 assert(buildNormalizedPath("/foo/../../", "bar/baz") == "/bar/baz"); in version()
1727 assert(buildNormalizedPath("/foo/bar", "../baz") == "/foo/baz"); in version()
1728 assert(buildNormalizedPath("/foo/bar", "../../baz") == "/baz"); in version()
1729 assert(buildNormalizedPath("/foo/bar", ".././/baz/..", "wee/") == "/foo/wee"); in version()
1730 assert(buildNormalizedPath("//foo/bar", "baz///wee") == "/foo/bar/baz/wee"); in version()
1731 static assert(buildNormalizedPath("/foo/..", "/bar/./baz") == "/bar/baz"); in version()
1735 assert(buildNormalizedPath(`\`, `foo`, `bar`) == `\foo\bar`); in version()
1736 assert(buildNormalizedPath(`foo`, `bar`, `baz`) == `foo\bar\baz`); in version()
1737 assert(buildNormalizedPath(`foo`, `bar\baz`) == `foo\bar\baz`); in version()
1738 assert(buildNormalizedPath(`foo`, `bar\\baz\\\`) == `foo\bar\baz`); in version()
1739 assert(buildNormalizedPath(`\foo`, `bar\baz`) == `\foo\bar\baz`); in version()
1740 assert(buildNormalizedPath(`\foo`, `\bar\baz`) == `\bar\baz`); in version()
1741 assert(buildNormalizedPath(`\foo\..`, `\bar\.\baz`) == `\bar\baz`); in version()
1742 assert(buildNormalizedPath(`\foo\..`, `bar\baz`) == `\bar\baz`); in version()
1743 assert(buildNormalizedPath(`\foo\..\..\`, `bar\baz`) == `\bar\baz`); in version()
1744 assert(buildNormalizedPath(`\foo\bar`, `..\baz`) == `\foo\baz`); in version()
1745 assert(buildNormalizedPath(`\foo\bar`, `../../baz`) == `\baz`); in version()
1746 assert(buildNormalizedPath(`\foo\bar`, `..\.\/baz\..`, `wee\`) == `\foo\wee`); in version()
1748 assert(buildNormalizedPath(`c:\`, `foo`, `bar`) == `c:\foo\bar`); in version()
1749 assert(buildNormalizedPath(`c:foo`, `bar`, `baz`) == `c:foo\bar\baz`); in version()
1750 assert(buildNormalizedPath(`c:foo`, `bar\baz`) == `c:foo\bar\baz`); in version()
1751 assert(buildNormalizedPath(`c:foo`, `bar\\baz\\\`) == `c:foo\bar\baz`); in version()
1752 assert(buildNormalizedPath(`c:\foo`, `bar\baz`) == `c:\foo\bar\baz`); in version()
1753 assert(buildNormalizedPath(`c:\foo`, `\bar\baz`) == `c:\bar\baz`); in version()
1754 assert(buildNormalizedPath(`c:\foo\..`, `\bar\.\baz`) == `c:\bar\baz`); in version()
1755 assert(buildNormalizedPath(`c:\foo\..`, `bar\baz`) == `c:\bar\baz`); in version()
1756 assert(buildNormalizedPath(`c:\foo\..\..\`, `bar\baz`) == `c:\bar\baz`); in version()
1757 assert(buildNormalizedPath(`c:\foo\bar`, `..\baz`) == `c:\foo\baz`); in version()
1758 assert(buildNormalizedPath(`c:\foo\bar`, `..\..\baz`) == `c:\baz`); in version()
1759 assert(buildNormalizedPath(`c:\foo\bar`, `..\.\\baz\..`, `wee\`) == `c:\foo\wee`); in version()
1761 assert(buildNormalizedPath(`\\server\share`, `foo`, `bar`) == `\\server\share\foo\bar`); in version()
1762 assert(buildNormalizedPath(`\\server\share\`, `foo`, `bar`) == `\\server\share\foo\bar`); in version()
1763 … assert(buildNormalizedPath(`\\server\share\foo`, `bar\baz`) == `\\server\share\foo\bar\baz`); in version()
1764 assert(buildNormalizedPath(`\\server\share\foo`, `\bar\baz`) == `\\server\share\bar\baz`); in version()
1765 … assert(buildNormalizedPath(`\\server\share\foo\..`, `\bar\.\baz`) == `\\server\share\bar\baz`); in version()
1766 assert(buildNormalizedPath(`\\server\share\foo\..`, `bar\baz`) == `\\server\share\bar\baz`); in version()
1767 … assert(buildNormalizedPath(`\\server\share\foo\..\..\`, `bar\baz`) == `\\server\share\bar\baz`); in version()
1768 assert(buildNormalizedPath(`\\server\share\foo\bar`, `..\baz`) == `\\server\share\foo\baz`); in version()
1769 assert(buildNormalizedPath(`\\server\share\foo\bar`, `..\..\baz`) == `\\server\share\baz`); in version()
1770 …assert(buildNormalizedPath(`\\server\share\foo\bar`, `..\.\\baz\..`, `wee\`) == `\\server\share\fo… in version()
1772 static assert(buildNormalizedPath(`\foo\..\..\`, `bar\baz`) == `\bar\baz`); in version()
1774 else static assert(0);
1783 assert(buildNormalizedPath(ary) == "a/b"); in version()
1787 assert(buildNormalizedPath(ary) == `a\b`); in version()
1881 static assert(dirSeparator.length == 1); in popFront()
1958 assert(asNormalizedPath("foo/..").array == ".");
1962 assert(asNormalizedPath("/foo/./bar/..//baz/").array == "/foo/baz"); in version()
1963 assert(asNormalizedPath("../foo/.").array == "../foo"); in version()
1964 assert(asNormalizedPath("/foo/bar/baz/").array == "/foo/bar/baz"); in version()
1965 assert(asNormalizedPath("/foo/./bar/../../baz").array == "/baz"); in version()
1970 assert(asNormalizedPath(`c:\foo\.\bar/..\\baz\`).array == `c:\foo\baz`); in version()
1971 assert(asNormalizedPath(`..\foo\.`).array == `..\foo`); in version()
1972 assert(asNormalizedPath(`c:\foo\bar\baz\`).array == `c:\foo\bar\baz`); in version()
1973 assert(asNormalizedPath(`c:\foo\bar/..`).array == `c:\foo`); in version()
1974 assert(asNormalizedPath(`\\server\share\foo\..\bar`).array == in version()
1987 assert(testAliasedString!asNormalizedPath(null));
1995 assert(asNormalizedPath("").array is null);
1996 assert(asNormalizedPath("foo").array == "foo");
1997 assert(asNormalizedPath(".").array == ".");
1998 assert(asNormalizedPath("./.").array == ".");
1999 assert(asNormalizedPath("foo/..").array == ".");
2003 assert(save.front == 'o');
2007 assert(asNormalizedPath("/foo/bar").array == "/foo/bar"); in version()
2008 assert(asNormalizedPath("foo/bar/baz").array == "foo/bar/baz"); in version()
2009 assert(asNormalizedPath("foo/bar/baz").array == "foo/bar/baz"); in version()
2010 assert(asNormalizedPath("foo/bar//baz///").array == "foo/bar/baz"); in version()
2011 assert(asNormalizedPath("/foo/bar/baz").array == "/foo/bar/baz"); in version()
2012 assert(asNormalizedPath("/foo/../bar/baz").array == "/bar/baz"); in version()
2013 assert(asNormalizedPath("/foo/../..//bar/baz").array == "/bar/baz"); in version()
2014 assert(asNormalizedPath("/foo/bar/../baz").array == "/foo/baz"); in version()
2015 assert(asNormalizedPath("/foo/bar/../../baz").array == "/baz"); in version()
2016 assert(asNormalizedPath("/foo/bar/.././/baz/../wee/").array == "/foo/wee"); in version()
2017 assert(asNormalizedPath("//foo/bar/baz///wee").array == "/foo/bar/baz/wee"); in version()
2019 assert(asNormalizedPath("foo//bar").array == "foo/bar"); in version()
2020 assert(asNormalizedPath("foo/bar").array == "foo/bar"); in version()
2023 assert(asNormalizedPath("./").array == "."); in version()
2024 assert(asNormalizedPath("././").array == "."); in version()
2025 assert(asNormalizedPath("./foo/..").array == "."); in version()
2026 assert(asNormalizedPath("foo/..").array == "."); in version()
2030 assert(asNormalizedPath(`\foo\bar`).array == `\foo\bar`); in version()
2031 assert(asNormalizedPath(`foo\bar\baz`).array == `foo\bar\baz`); in version()
2032 assert(asNormalizedPath(`foo\bar\baz`).array == `foo\bar\baz`); in version()
2033 assert(asNormalizedPath(`foo\bar\\baz\\\`).array == `foo\bar\baz`); in version()
2034 assert(asNormalizedPath(`\foo\bar\baz`).array == `\foo\bar\baz`); in version()
2035 assert(asNormalizedPath(`\foo\..\\bar\.\baz`).array == `\bar\baz`); in version()
2036 assert(asNormalizedPath(`\foo\..\bar\baz`).array == `\bar\baz`); in version()
2037 assert(asNormalizedPath(`\foo\..\..\\bar\baz`).array == `\bar\baz`); in version()
2039 assert(asNormalizedPath(`\foo\bar\..\baz`).array == `\foo\baz`); in version()
2040 assert(asNormalizedPath(`\foo\bar\../../baz`).array == `\baz`); in version()
2041 assert(asNormalizedPath(`\foo\bar\..\.\/baz\..\wee\`).array == `\foo\wee`); in version()
2043 assert(asNormalizedPath(`c:\foo\bar`).array == `c:\foo\bar`); in version()
2044 assert(asNormalizedPath(`c:foo\bar\baz`).array == `c:foo\bar\baz`); in version()
2045 assert(asNormalizedPath(`c:foo\bar\baz`).array == `c:foo\bar\baz`); in version()
2046 assert(asNormalizedPath(`c:foo\bar\\baz\\\`).array == `c:foo\bar\baz`); in version()
2047 assert(asNormalizedPath(`c:\foo\bar\baz`).array == `c:\foo\bar\baz`); in version()
2049 assert(asNormalizedPath(`c:\foo\..\\bar\.\baz`).array == `c:\bar\baz`); in version()
2050 assert(asNormalizedPath(`c:\foo\..\bar\baz`).array == `c:\bar\baz`); in version()
2051 assert(asNormalizedPath(`c:\foo\..\..\\bar\baz`).array == `c:\bar\baz`); in version()
2052 assert(asNormalizedPath(`c:\foo\bar\..\baz`).array == `c:\foo\baz`); in version()
2053 assert(asNormalizedPath(`c:\foo\bar\..\..\baz`).array == `c:\baz`); in version()
2054 assert(asNormalizedPath(`c:\foo\bar\..\.\\baz\..\wee\`).array == `c:\foo\wee`); in version()
2055 assert(asNormalizedPath(`\\server\share\foo\bar`).array == `\\server\share\foo\bar`); in version()
2056 assert(asNormalizedPath(`\\server\share\\foo\bar`).array == `\\server\share\foo\bar`); in version()
2057 … assert(asNormalizedPath(`\\server\share\foo\bar\baz`).array == `\\server\share\foo\bar\baz`); in version()
2058 … assert(asNormalizedPath(`\\server\share\foo\..\\bar\.\baz`).array == `\\server\share\bar\baz`); in version()
2059 assert(asNormalizedPath(`\\server\share\foo\..\bar\baz`).array == `\\server\share\bar\baz`); in version()
2060 … assert(asNormalizedPath(`\\server\share\foo\..\..\\bar\baz`).array == `\\server\share\bar\baz`); in version()
2061 assert(asNormalizedPath(`\\server\share\foo\bar\..\baz`).array == `\\server\share\foo\baz`); in version()
2062 assert(asNormalizedPath(`\\server\share\foo\bar\..\..\baz`).array == `\\server\share\baz`); in version()
2063 …assert(asNormalizedPath(`\\server\share\foo\bar\..\.\\baz\..\wee\`).array == `\\server\share\foo\w… in version()
2065 static assert(asNormalizedPath(`\foo\..\..\\bar\baz`).array == `\bar\baz`); in version()
2067 assert(asNormalizedPath("foo//bar").array == `foo\bar`); in version()
2070 assert(asNormalizedPath(`.\`).array == "."); in version()
2071 assert(asNormalizedPath(`.\.\`).array == "."); in version()
2072 assert(asNormalizedPath(`.\foo\..`).array == "."); in version()
2073 assert(asNormalizedPath(`foo\..`).array == "."); in version()
2075 else static assert(0);
2085 assert(asNormalizedPath("").empty); in version()
2086 assert(asNormalizedPath("foo/bar").array == "foo/bar"); in version()
2089 assert(asNormalizedPath("/").array == "/"); in version()
2090 assert(asNormalizedPath("///").array == "/"); in version()
2091 assert(asNormalizedPath("////").array == "/"); in version()
2092 assert(asNormalizedPath("/foo/bar").array == "/foo/bar"); in version()
2093 assert(asNormalizedPath("//foo/bar").array == "/foo/bar"); in version()
2094 assert(asNormalizedPath("///foo/bar").array == "/foo/bar"); in version()
2095 assert(asNormalizedPath("////foo/bar").array == "/foo/bar"); in version()
2098 assert(asNormalizedPath("/./foo").array == "/foo"); in version()
2099 assert(asNormalizedPath("/foo/./bar").array == "/foo/bar"); in version()
2101 assert(asNormalizedPath("./foo").array == "foo"); in version()
2102 assert(asNormalizedPath("././foo").array == "foo"); in version()
2103 assert(asNormalizedPath("foo/././bar").array == "foo/bar"); in version()
2106 assert(asNormalizedPath("/foo/../bar").array == "/bar"); in version()
2107 assert(asNormalizedPath("/foo/../../bar").array == "/bar"); in version()
2108 assert(asNormalizedPath("/../foo").array == "/foo"); in version()
2109 assert(asNormalizedPath("/../../foo").array == "/foo"); in version()
2110 assert(asNormalizedPath("/foo/..").array == "/"); in version()
2111 assert(asNormalizedPath("/foo/../..").array == "/"); in version()
2113 assert(asNormalizedPath("foo/../bar").array == "bar"); in version()
2114 assert(asNormalizedPath("foo/../../bar").array == "../bar"); in version()
2115 assert(asNormalizedPath("../foo").array == "../foo"); in version()
2116 assert(asNormalizedPath("../../foo").array == "../../foo"); in version()
2117 assert(asNormalizedPath("../foo/../bar").array == "../bar"); in version()
2118 assert(asNormalizedPath(".././../foo").array == "../../foo"); in version()
2119 assert(asNormalizedPath("foo/bar/..").array == "foo"); in version()
2120 assert(asNormalizedPath("/foo/../..").array == "/"); in version()
2123 assert(asNormalizedPath("/foo/../bar//./../...///baz//").array == "/.../baz"); in version()
2124 static assert(asNormalizedPath("/foo/../bar//./../...///baz//").array == "/.../baz"); in version()
2129 assert(asNormalizedPath("").empty); in version()
2130 assert(asNormalizedPath(`foo\bar`).array == `foo\bar`); in version()
2131 assert(asNormalizedPath("foo/bar").array == `foo\bar`); in version()
2134 assert(asNormalizedPath("/").array == `\`); in version()
2135 assert(asNormalizedPath(`\`).array == `\`); in version()
2136 assert(asNormalizedPath(`\\\`).array == `\`); in version()
2137 assert(asNormalizedPath(`\\\\`).array == `\`); in version()
2138 assert(asNormalizedPath(`\foo\bar`).array == `\foo\bar`); in version()
2139 assert(asNormalizedPath(`\\foo`).array == `\\foo`); in version()
2140 assert(asNormalizedPath(`\\foo\\`).array == `\\foo`); in version()
2141 assert(asNormalizedPath(`\\foo/bar`).array == `\\foo\bar`); in version()
2142 assert(asNormalizedPath(`\\\foo\bar`).array == `\foo\bar`); in version()
2143 assert(asNormalizedPath(`\\\\foo\bar`).array == `\foo\bar`); in version()
2144 assert(asNormalizedPath(`c:\`).array == `c:\`); in version()
2145 assert(asNormalizedPath(`c:\foo\bar`).array == `c:\foo\bar`); in version()
2146 assert(asNormalizedPath(`c:\\foo\bar`).array == `c:\foo\bar`); in version()
2149 assert(asNormalizedPath(`\./foo`).array == `\foo`); in version()
2150 assert(asNormalizedPath(`\foo/.\bar`).array == `\foo\bar`); in version()
2152 assert(asNormalizedPath(`.\foo`).array == `foo`); in version()
2153 assert(asNormalizedPath(`./.\foo`).array == `foo`); in version()
2154 assert(asNormalizedPath(`foo\.\./bar`).array == `foo\bar`); in version()
2157 assert(asNormalizedPath(`\foo\..\bar`).array == `\bar`); in version()
2158 assert(asNormalizedPath(`\foo\../..\bar`).array == `\bar`); in version()
2159 assert(asNormalizedPath(`\..\foo`).array == `\foo`); in version()
2160 assert(asNormalizedPath(`\..\..\foo`).array == `\foo`); in version()
2161 assert(asNormalizedPath(`\foo\..`).array == `\`); in version()
2162 assert(asNormalizedPath(`\foo\../..`).array == `\`); in version()
2164 assert(asNormalizedPath(`foo\..\bar`).array == `bar`); in version()
2165 assert(asNormalizedPath(`foo\..\../bar`).array == `..\bar`); in version()
2167 assert(asNormalizedPath(`..\foo`).array == `..\foo`); in version()
2168 assert(asNormalizedPath(`..\..\foo`).array == `..\..\foo`); in version()
2169 assert(asNormalizedPath(`..\foo\..\bar`).array == `..\bar`); in version()
2170 assert(asNormalizedPath(`..\.\..\foo`).array == `..\..\foo`); in version()
2171 assert(asNormalizedPath(`foo\bar\..`).array == `foo`); in version()
2172 assert(asNormalizedPath(`\foo\..\..`).array == `\`); in version()
2173 assert(asNormalizedPath(`c:\foo\..\..`).array == `c:\`); in version()
2176 assert(asNormalizedPath(`c:foo`).array == `c:foo`); in version()
2177 assert(asNormalizedPath(`c:..\foo\.\..\bar`).array == `c:..\bar`); in version()
2180 assert(asNormalizedPath(`c:\foo\..\bar\\.\..\...\\\baz\\`).array == `c:\...\baz`); in version()
2181 static assert(asNormalizedPath(`c:\foo\..\bar\\.\..\...\\\baz\\`).array == `c:\...\baz`); in version()
2183 else static assert(false);
2205 assert(!empty); in front()
2211 assert(!empty); in popFront()
2236 assert(!empty); in back()
2242 assert(!empty); in popBack()
2309 assert(!isRooted(_path)); in this()
2326 else static assert(0); in this()
2364 assert(equal(pathSplitter("/"), ["/"]));
2365 assert(equal(pathSplitter("/foo/bar"), ["/", "foo", "bar"]));
2366 assert(equal(pathSplitter("foo/../bar//./"), ["foo", "..", "bar", "."]));
2370 assert(equal(pathSplitter("//foo/bar"), ["/", "foo", "bar"])); in version()
2375 assert(equal(pathSplitter(`foo\..\bar\/.\`), ["foo", "..", "bar", "."])); in version()
2376 assert(equal(pathSplitter("c:"), ["c:"])); in version()
2377 assert(equal(pathSplitter(`c:\foo\bar`), [`c:\`, "foo", "bar"])); in version()
2378 assert(equal(pathSplitter(`c:foo\bar`), ["c:foo", "bar"])); in version()
2391 assert(testAliasedString!pathSplitter("/"));
2402 static assert(isBidirectionalRange!R1); in equal2()
2406 assert(pathSplitter("").empty);
2409 assert(equal2(pathSplitter("/"), ["/"]));
2410 assert(equal2(pathSplitter("//"), ["/"]));
2411 assert(equal2(pathSplitter("///"w), ["/"w]));
2414 assert(equal2(pathSplitter("/foo/bar".dup), ["/", "foo", "bar"]));
2417 assert(equal2(pathSplitter("foo/bar"d.dup), ["foo"d, "bar"d]));
2418 assert(equal2(pathSplitter("foo//bar"), ["foo", "bar"]));
2419 assert(equal2(pathSplitter("foo/bar//"w), ["foo"w, "bar"w]));
2420 assert(equal2(pathSplitter("foo/../bar//./"d), ["foo"d, ".."d, "bar"d, "."d]));
2426 assert(equal2(ps1, ["bar", "baz"]));
2427 assert(equal2(ps2, ["foo", "bar", "baz"]));
2432 assert(equal2(pathSplitter("//foo/bar"w.dup), ["/"w, "foo"w, "bar"w])); in version()
2436 assert(equal2(pathSplitter(`\`), [`\`])); in version()
2437 assert(equal2(pathSplitter(`foo\..\bar\/.\`), ["foo", "..", "bar", "."])); in version()
2438 assert(equal2(pathSplitter("c:"), ["c:"])); in version()
2439 assert(equal2(pathSplitter(`c:\foo\bar`), [`c:\`, "foo", "bar"])); in version()
2440 assert(equal2(pathSplitter(`c:foo\bar`), ["c:foo", "bar"])); in version()
2441 assert(equal2(pathSplitter(`\\foo\bar`), [`\\foo\bar`])); in version()
2442 assert(equal2(pathSplitter(`\\foo\bar\\`), [`\\foo\bar`])); in version()
2443 assert(equal2(pathSplitter(`\\foo\bar\baz`), [`\\foo\bar`, "baz"])); in version()
2449 assert(equal(pathSplitter("/foo/bar".dup), ["/", "foo", "bar"]));
2452 static assert(is(typeof(pathSplitter!(const(char)[])(null).front) == const(char)[]));
2455 assert(equal2(pathSplitter("foo/bar"d.byDchar), ["foo"d, "bar"d]));
2505 assert(isRooted("/"));
2506 assert(isRooted("/foo"));
2507 assert(!isRooted("foo"));
2508 assert(!isRooted("../foo"));
2512 assert(isRooted(`\`)); in version()
2513 assert(isRooted(`\foo`)); in version()
2514 assert(isRooted(`d:\foo`)); in version()
2515 assert(isRooted(`\\foo\bar`)); in version()
2516 assert(!isRooted("foo")); in version()
2517 assert(!isRooted("d:foo")); in version()
2520 static assert(isRooted("/foo"));
2521 static assert(!isRooted("foo"));
2524 assert(!isRooted(DirEntry("foo")));
2588 assert(!isAbsolute("foo"));
2589 assert(!isAbsolute("../foo"w));
2590 static assert(!isAbsolute("foo"));
2594 assert(isAbsolute("/"d)); in version()
2595 assert(isAbsolute("/foo".dup)); in version()
2596 static assert(isAbsolute("/foo")); in version()
2601 assert(isAbsolute("d:\\"w)); in version()
2602 assert(isAbsolute("d:\\foo"d)); in version()
2603 assert(isAbsolute("\\\\foo\\bar")); in version()
2604 assert(!isAbsolute("\\"w.dup)); in version()
2605 assert(!isAbsolute("\\foo"d.dup)); in version()
2606 assert(!isAbsolute("d:")); in version()
2607 assert(!isAbsolute("d:foo")); in version()
2608 static assert(isAbsolute(`d:\foo`)); in version()
2613 assert(!r.isAbsolute());
2617 assert(!isAbsolute(DirEntry("foo")));
2665 assert(absolutePath("some/file", "/foo/bar") == "/foo/bar/some/file"); in version()
2666 assert(absolutePath("../file", "/foo/bar") == "/foo/bar/../file"); in version()
2667 assert(absolutePath("/some/file", "/foo/bar") == "/some/file"); in version()
2672 assert(absolutePath(`some\file`, `c:\foo\bar`) == `c:\foo\bar\some\file`); in version()
2673 assert(absolutePath(`..\file`, `c:\foo\bar`) == `c:\foo\bar\..\file`); in version()
2674 assert(absolutePath(`c:\some\file`, `c:\foo\bar`) == `c:\some\file`); in version()
2675 assert(absolutePath(`\`, `c:\`) == `c:\`); in version()
2676 assert(absolutePath(`\some\file`, `c:\foo\bar`) == `c:\some\file`); in version()
2684 static assert(absolutePath("some/file", "/foo/bar") == "/foo/bar/some/file"); in version()
2689 static assert(absolutePath(`some\file`, `c:\foo\bar`) == `c:\foo\bar\some\file`); in version()
2731 assert(asAbsolutePath(cast(string) null).array == "");
2734 assert(asAbsolutePath("/foo").array == "/foo"); in version()
2738 assert(asAbsolutePath("c:/foo").array == "c:/foo"); in version()
2751 assert(testAliasedString!asAbsolutePath(null));
2810 assert(relativePath("foo") == "foo");
2814 assert(relativePath("foo", "/bar") == "foo"); in version()
2815 assert(relativePath("/foo/bar", "/foo/bar") == "."); in version()
2816 assert(relativePath("/foo/bar", "/foo/baz") == "../bar"); in version()
2817 assert(relativePath("/foo/bar/baz", "/foo/woo/wee") == "../../bar/baz"); in version()
2818 assert(relativePath("/foo/bar/baz", "/foo/bar") == "baz"); in version()
2822 assert(relativePath("foo", `c:\bar`) == "foo"); in version()
2823 assert(relativePath(`c:\foo\bar`, `c:\foo\bar`) == "."); in version()
2824 assert(relativePath(`c:\foo\bar`, `c:\foo\baz`) == `..\bar`); in version()
2825 assert(relativePath(`c:\foo\bar\baz`, `c:\foo\woo\wee`) == `..\..\bar\baz`); in version()
2826 assert(relativePath(`c:\foo\bar\baz`, `c:\foo\bar`) == "baz"); in version()
2827 assert(relativePath(`c:\foo\bar`, `d:\foo`) == `c:\foo\bar`); in version()
2834 assert(relativePath("foo") == "foo");
2838 assert(relativePath("/foo/bar", "/foo/baz") == "../bar"); in version()
2844 assert(relativePath(`c:\foo\bar\baz`, `c:\foo\bar`) == "baz"); in version()
2847 else static assert(0);
2944 assert(asRelativePath("foo", "/bar").array == "foo"); in version()
2945 assert(asRelativePath("/foo/bar", "/foo/bar").array == "."); in version()
2946 assert(asRelativePath("/foo/bar", "/foo/baz").array == "../bar"); in version()
2947 assert(asRelativePath("/foo/bar/baz", "/foo/woo/wee").array == "../../bar/baz"); in version()
2948 assert(asRelativePath("/foo/bar/baz", "/foo/bar").array == "baz"); in version()
2952 assert(asRelativePath("foo", `c:\bar`).array == "foo"); in version()
2953 assert(asRelativePath(`c:\foo\bar`, `c:\foo\bar`).array == "."); in version()
2954 assert(asRelativePath(`c:\foo\bar`, `c:\foo\baz`).array == `..\bar`); in version()
2955 assert(asRelativePath(`c:\foo\bar\baz`, `c:\foo\woo\wee`).array == `..\..\bar\baz`); in version()
2956 assert(asRelativePath(`c:/foo/bar/baz`, `c:\foo\woo\wee`).array == `..\..\bar\baz`); in version()
2957 assert(asRelativePath(`c:\foo\bar\baz`, `c:\foo\bar`).array == "baz"); in version()
2958 assert(asRelativePath(`c:\foo\bar`, `d:\foo`).array == `c:\foo\bar`); in version()
2959 assert(asRelativePath(`\\foo\bar`, `c:\foo`).array == `\\foo\bar`); in version()
2962 static assert(0);
2978 assert(asRelativePath(TestAliasedString("foo"), TestAliasedString("/bar")).array == "foo");
2980 … assert(asRelativePath(TestAliasedString("foo"), TestAliasedString(`c:\bar`)).array == "foo");
2981 assert(asRelativePath(TestAliasedString("foo"), "bar").array == "foo");
2982 assert(asRelativePath("foo", TestAliasedString("bar")).array == "foo");
2983 assert(asRelativePath(TestAliasedString("foo"), TestAliasedString("bar")).array == "foo");
2985 assert(asRelativePath("foo"d.byDchar, TestAliasedString("bar")).array == "foo");
2993 assert(asRelativePath("/foo/bar/baz".bCU, "/foo/bar".bCU).array == "baz"); in version()
2994 assert(asRelativePath("/foo/bar/baz"w.bCU, "/foo/bar"w.bCU).array == "baz"w); in version()
2995 assert(asRelativePath("/foo/bar/baz"d.bCU, "/foo/bar"d.bCU).array == "baz"d); in version()
2999 assert(asRelativePath(`\\foo\bar`.bCU, `c:\foo`.bCU).array == `\\foo\bar`); in version()
3000 assert(asRelativePath(`\\foo\bar`w.bCU, `c:\foo`w.bCU).array == `\\foo\bar`w); in version()
3001 assert(asRelativePath(`\\foo\bar`d.bCU, `c:\foo`d.bCU).array == `\\foo\bar`d); in version()
3040 assert(filenameCharCmp('a', 'a') == 0);
3041 assert(filenameCharCmp('a', 'b') < 0);
3042 assert(filenameCharCmp('b', 'a') > 0);
3047 assert(filenameCharCmp('A', 'a') < 0); in version()
3048 assert(filenameCharCmp('a', 'A') > 0); in version()
3053 assert(filenameCharCmp('a', 'A') == 0); in version()
3054 assert(filenameCharCmp('a', 'B') < 0); in version()
3055 assert(filenameCharCmp('A', 'b') < 0); in version()
3061 assert(filenameCharCmp!(CaseSensitive.yes)('A', 'a') < 0);
3062 assert(filenameCharCmp!(CaseSensitive.yes)('a', 'A') > 0);
3064 assert(filenameCharCmp!(CaseSensitive.no)('a', 'a') == 0);
3065 assert(filenameCharCmp!(CaseSensitive.no)('a', 'b') < 0);
3066 assert(filenameCharCmp!(CaseSensitive.no)('b', 'a') > 0);
3067 assert(filenameCharCmp!(CaseSensitive.no)('A', 'a') == 0);
3068 assert(filenameCharCmp!(CaseSensitive.no)('a', 'A') == 0);
3069 assert(filenameCharCmp!(CaseSensitive.no)('a', 'B') < 0);
3070 assert(filenameCharCmp!(CaseSensitive.no)('B', 'a') > 0);
3071 assert(filenameCharCmp!(CaseSensitive.no)('A', 'b') < 0);
3072 assert(filenameCharCmp!(CaseSensitive.no)('b', 'A') > 0);
3074 version (Posix) assert(filenameCharCmp('\\', '/') != 0);
3075 version (Windows) assert(filenameCharCmp('\\', '/') == 0);
3144 assert(filenameCmp("abc", "abc") == 0);
3145 assert(filenameCmp("abc", "abd") < 0);
3146 assert(filenameCmp("abc", "abb") > 0);
3147 assert(filenameCmp("abc", "abcd") < 0);
3148 assert(filenameCmp("abcd", "abc") > 0);
3153 assert(filenameCmp("Abc", "abc") < 0); in version()
3154 assert(filenameCmp("abc", "Abc") > 0); in version()
3159 assert(filenameCmp("Abc", "abc") == 0); in version()
3160 assert(filenameCmp("abc", "Abc") == 0); in version()
3161 assert(filenameCmp("Abc", "abD") < 0); in version()
3162 assert(filenameCmp("abc", "AbB") > 0); in version()
3177 assert(filenameCmp!(CaseSensitive.yes)(TestAliasedString("Abc"), "abc") < 0);
3178 assert(filenameCmp!(CaseSensitive.yes)("Abc", TestAliasedString("abc")) < 0);
3179 assert(filenameCmp!(CaseSensitive.yes)(TestAliasedString("Abc"), TestAliasedString("abc")) < 0);
3184 assert(filenameCmp!(CaseSensitive.yes)("Abc", "abc") < 0);
3185 assert(filenameCmp!(CaseSensitive.yes)("abc", "Abc") > 0);
3187 assert(filenameCmp!(CaseSensitive.no)("abc", "abc") == 0);
3188 assert(filenameCmp!(CaseSensitive.no)("abc", "abd") < 0);
3189 assert(filenameCmp!(CaseSensitive.no)("abc", "abb") > 0);
3190 assert(filenameCmp!(CaseSensitive.no)("abc", "abcd") < 0);
3191 assert(filenameCmp!(CaseSensitive.no)("abcd", "abc") > 0);
3192 assert(filenameCmp!(CaseSensitive.no)("Abc", "abc") == 0);
3193 assert(filenameCmp!(CaseSensitive.no)("abc", "Abc") == 0);
3194 assert(filenameCmp!(CaseSensitive.no)("Abc", "abD") < 0);
3195 assert(filenameCmp!(CaseSensitive.no)("abc", "AbB") > 0);
3197 version (Posix) assert(filenameCmp(`abc\def`, `abc/def`) != 0);
3198 version (Windows) assert(filenameCmp(`abc\def`, `abc/def`) == 0);
3251 assert(balancedParens(pattern, '[', ']', 0));
3252 assert(balancedParens(pattern, '{', '}', 0));
3394 assert(globMatch("foo.bar", "*"));
3395 assert(globMatch("foo.bar", "*.*"));
3396 assert(globMatch(`foo/foo\bar`, "f*b*r"));
3397 assert(globMatch("foo.bar", "f???bar"));
3398 assert(globMatch("foo.bar", "[fg]???bar"));
3399 assert(globMatch("foo.bar", "[!gh]*bar"));
3400 assert(globMatch("bar.fooz", "bar.{foo,bif}z"));
3401 assert(globMatch("bar.bifz", "bar.{foo,bif}z"));
3406 assert(globMatch("foo", "Foo")); in version()
3407 assert(globMatch("Goo.bar", "[fg]???bar")); in version()
3412 assert(!globMatch("foo", "Foo")); in version()
3413 assert(!globMatch("Goo.bar", "[fg]???bar")); in version()
3427 assert(testAliasedString!globMatch("foo.bar", "*"));
3432 assert(globMatch!(CaseSensitive.no)("foo", "Foo"));
3433 assert(!globMatch!(CaseSensitive.yes)("foo", "Foo"));
3435 assert(globMatch("foo", "*"));
3436 assert(globMatch("foo.bar"w, "*"w));
3437 assert(globMatch("foo.bar"d, "*.*"d));
3438 assert(globMatch("foo.bar", "foo*"));
3439 assert(globMatch("foo.bar"w, "f*bar"w));
3440 assert(globMatch("foo.bar"d, "f*b*r"d));
3441 assert(globMatch("foo.bar", "f???bar"));
3442 assert(globMatch("foo.bar"w, "[fg]???bar"w));
3443 assert(globMatch("foo.bar"d, "[!gh]*bar"d));
3445 assert(!globMatch("foo", "bar"));
3446 assert(!globMatch("foo"w, "*.*"w));
3447 assert(!globMatch("foo.bar"d, "f*baz"d));
3448 assert(!globMatch("foo.bar", "f*b*x"));
3449 assert(!globMatch("foo.bar", "[gh]???bar"));
3450 assert(!globMatch("foo.bar"w, "[!fg]*bar"w));
3451 assert(!globMatch("foo.bar"d, "[fg]???baz"d));
3452 assert(!globMatch("foo.di", "*.d")); // test issue 6634: triggered bad assertion
3454 assert(globMatch("foo.bar", "{foo,bif}.bar"));
3455 assert(globMatch("bif.bar"w, "{foo,bif}.bar"w));
3457 assert(globMatch("bar.foo"d, "bar.{foo,bif}"d));
3458 assert(globMatch("bar.bif", "bar.{foo,bif}"));
3460 assert(globMatch("bar.fooz"w, "bar.{foo,bif}z"w));
3461 assert(globMatch("bar.bifz"d, "bar.{foo,bif}z"d));
3463 assert(globMatch("bar.foo", "bar.{biz,,baz}foo"));
3464 assert(globMatch("bar.foo"w, "bar.{biz,}foo"w));
3465 assert(globMatch("bar.foo"d, "bar.{,biz}foo"d));
3466 assert(globMatch("bar.foo", "bar.{}foo"));
3468 assert(globMatch("bar.foo"w, "bar.{ar,,fo}o"w));
3469 assert(globMatch("bar.foo"d, "bar.{,ar,fo}o"d));
3470 assert(globMatch("bar.o", "bar.{,ar,fo}o"));
3472 assert(!globMatch("foo", "foo?"));
3473 assert(!globMatch("foo", "foo[]"));
3474 assert(!globMatch("foo", "foob"));
3475 assert(!globMatch("foo", "foo{b}"));
3478 static assert(globMatch("foo.bar", "[!gh]*bar"));
3549 else static assert(0);
3567 assert(isValidFilename("hello.exe".byCodeUnit));
3578 assert(testAliasedString!isValidFilename("hello.exe"));
3590 else static assert(0);
3597 assert(isValidFilename(to!T(fn)));
3599 assert(!isValidFilename(to!T(fn)));
3604 assert(!isValidFilename(r));
3608 assert(isValidFilename(DirEntry("file.ext")));
3619 assert(!isValidFilename(buf[])); in version()
3670 assert(component.length > 0); in isValidComponent()
3737 else static assert(0);
3745 assert(i > 0);
3758 assert(isValidPath("/foo/bar"));
3759 assert(!isValidPath("/foo\0/bar"));
3760 assert(isValidPath("/"));
3761 assert(isValidPath("a"));
3765 assert(isValidPath(`c:\`));
3766 assert(isValidPath(`c:\foo`));
3767 assert(isValidPath(`c:\foo\.\bar\\\..\`));
3768 assert(!isValidPath(`!:\foo`));
3769 assert(!isValidPath(`c::\foo`));
3770 assert(!isValidPath(`c:\foo?`));
3771 assert(!isValidPath(`c:\foo.`));
3773 assert(isValidPath(`\\server\share`));
3774 assert(isValidPath(`\\server\share\foo`));
3775 assert(isValidPath(`\\server\share\\foo`));
3776 assert(!isValidPath(`\\\server\share\foo`));
3777 assert(!isValidPath(`\\server\\share\foo`));
3778 assert(!isValidPath(`\\ser*er\share\foo`));
3779 assert(!isValidPath(`\\server\sha?e\foo`));
3780 assert(!isValidPath(`\\server\share\|oo`));
3782 assert(isValidPath(`\\?\<>:"?*|/\..\.`));