Lines Matching refs:assert
135 else static assert(0, "unsupported platform");
145 else static assert(0, "unsupported platform");
167 assert( '/'.isDirSeparator); in version()
168 assert( '\\'.isDirSeparator); in version()
172 assert( '/'.isDirSeparator);
173 assert(!'\\'.isDirSeparator);
226 in { assert(isUNC(path)); } in version()
287 assert(ltrimDirSeparators("//abc//").array == "abc//");
288 assert(ltrimDirSeparators("//abc//"d).array == "abc//"d);
289 assert(ltrimDirSeparators("//abc//".byDchar).array == "abc//"d);
316 assert(rtrimDirSeparators("//abc//").array == "//abc");
317 assert(rtrimDirSeparators("//abc//"d).array == "//abc"d);
319 assert(rtrimDirSeparators(MockBiRange!char("//abc//")).array == "//abc");
334 assert(trimDirSeparators("//abc//").array == "abc");
335 assert(trimDirSeparators("//abc//"d).array == "abc"d);
337 assert(trimDirSeparators(MockBiRange!char("//abc//")).array == "abc");
362 assert(baseName!(CaseSensitive.no)("dir/file.EXT", ".ext") == "file");
363 assert(baseName!(CaseSensitive.yes)("dir/file.EXT", ".ext") != "file");
366 assert(relativePath!(CaseSensitive.no)("/FOO/bar", "/foo/baz") == "../bar");
368 assert(relativePath!(CaseSensitive.no)(`c:\FOO\bar`, `c:\foo\baz`) == `..\bar`);
374 else static assert(0);
439 assert(baseName("dir/file.ext") == "file.ext");
440 assert(baseName("dir/file.ext", ".ext") == "file");
441 assert(baseName("dir/file.ext", ".xyz") == "file.ext");
442 assert(baseName("dir/filename", "name") == "file");
443 assert(baseName("dir/subdir/") == "subdir");
447 assert(baseName(`d:file.ext`) == "file.ext"); in version()
448 assert(baseName(`d:\dir\file.ext`) == "file.ext"); in version()
454 assert(baseName("").empty);
455 assert(baseName("file.ext"w) == "file.ext");
456 assert(baseName("file.ext"d, ".ext") == "file");
457 assert(baseName("file", "file"w.dup) == "file");
458 assert(baseName("dir/file.ext"d.dup) == "file.ext");
459 assert(baseName("dir/file.ext", ".ext"d) == "file");
460 assert(baseName("dir/file"w, "file"d) == "file");
461 assert(baseName("dir///subdir////") == "subdir");
462 assert(baseName("dir/subdir.ext/", ".ext") == "subdir");
463 assert(baseName("dir/subdir/".dup, "subdir") == "subdir");
464 assert(baseName("/"w.dup) == "/");
465 assert(baseName("//"d.dup) == "/");
466 assert(baseName("///") == "/");
468 assert(baseName!(CaseSensitive.yes)("file.ext", ".EXT") == "file.ext");
469 assert(baseName!(CaseSensitive.no)("file.ext", ".EXT") == "file");
475 assert(s[i] == c);
480 assert(baseName(`dir\file.ext`) == `file.ext`); in version()
481 assert(baseName(`dir\file.ext`, `.ext`) == `file`); in version()
482 assert(baseName(`dir\file`, `file`) == `file`); in version()
483 assert(baseName(`d:file.ext`) == `file.ext`); in version()
484 assert(baseName(`d:file.ext`, `.ext`) == `file`); in version()
485 assert(baseName(`d:file`, `file`) == `file`); in version()
486 assert(baseName(`dir\\subdir\\\`) == `subdir`); in version()
487 assert(baseName(`dir\subdir.ext\`, `.ext`) == `subdir`); in version()
488 assert(baseName(`dir\subdir\`, `subdir`) == `subdir`); in version()
489 assert(baseName(`\`) == `\`); in version()
490 assert(baseName(`\\`) == `\`); in version()
491 assert(baseName(`\\\`) == `\`); in version()
492 assert(baseName(`d:\`) == `\`); in version()
493 assert(baseName(`d:`).empty); in version()
494 assert(baseName(`\\server\share\file`) == `file`); in version()
495 assert(baseName(`\\server\share\`) == `\`); in version()
496 assert(baseName(`\\server\share`) == `\`); in version()
501 assert(s[i] == c); in version()
504 assert(baseName(stripExtension("dir/file.ext")) == "file");
506 static assert(baseName("dir/file.ext") == "file.ext");
507 static assert(baseName("dir/file.ext", ".ext") == "file");
510 assert(baseName(DirEntry("dir/file.ext")) == "file.ext");
515 assert(testAliasedString!baseName("file"));
518 assert(S.a.baseName == "test");
521 assert(sa.baseName == "test");
576 assert(dirName("") == ".");
577 assert(dirName("file"w) == ".");
578 assert(dirName("dir/"d) == ".");
579 assert(dirName("dir///") == ".");
580 assert(dirName("dir/file"w.dup) == "dir");
581 assert(dirName("dir///file"d.dup) == "dir");
582 assert(dirName("dir/subdir/") == "dir");
583 assert(dirName("/dir/file"w) == "/dir");
584 assert(dirName("/file"d) == "/");
585 assert(dirName("/") == "/");
586 assert(dirName("///") == "/");
590 assert(dirName(`dir\`) == `.`); in version()
591 assert(dirName(`dir\\\`) == `.`); in version()
592 assert(dirName(`dir\file`) == `dir`); in version()
593 assert(dirName(`dir\\\file`) == `dir`); in version()
594 assert(dirName(`dir\subdir\`) == `dir`); in version()
595 assert(dirName(`\dir\file`) == `\dir`); in version()
596 assert(dirName(`\file`) == `\`); in version()
597 assert(dirName(`\`) == `\`); in version()
598 assert(dirName(`\\\`) == `\`); in version()
599 assert(dirName(`d:`) == `d:`); in version()
600 assert(dirName(`d:file`) == `d:`); in version()
601 assert(dirName(`d:\`) == `d:\`); in version()
602 assert(dirName(`d:\file`) == `d:\`); in version()
603 assert(dirName(`d:\dir\file`) == `d:\dir`); in version()
604 assert(dirName(`\\server\share\dir\file`) == `\\server\share\dir`); in version()
605 assert(dirName(`\\server\share\file`) == `\\server\share`); in version()
606 assert(dirName(`\\server\share\`) == `\\server\share`); in version()
607 assert(dirName(`\\server\share`) == `\\server\share`); in version()
613 assert(testAliasedString!dirName("file"));
616 assert(S.a.dirName == "file/path/to");
619 assert(sa.dirName == "file/path/to");
624 static assert(dirName("dir/file") == "dir");
629 assert(dirName("".byChar).array == ".");
630 assert(dirName("file"w.byWchar).array == "."w);
631 assert(dirName("dir/"d.byDchar).array == "."d);
632 assert(dirName("dir///".byChar).array == ".");
633 assert(dirName("dir/subdir/".byChar).array == "dir");
634 assert(dirName("/dir/file"w.byWchar).array == "/dir"w);
635 assert(dirName("/file"d.byDchar).array == "/"d);
636 assert(dirName("/".byChar).array == "/");
637 assert(dirName("///".byChar).array == "/");
641 assert(dirName(`dir\`.byChar).array == `.`); in version()
642 assert(dirName(`dir\\\`.byChar).array == `.`); in version()
643 assert(dirName(`dir\file`.byChar).array == `dir`); in version()
644 assert(dirName(`dir\\\file`.byChar).array == `dir`); in version()
645 assert(dirName(`dir\subdir\`.byChar).array == `dir`); in version()
646 assert(dirName(`\dir\file`.byChar).array == `\dir`); in version()
647 assert(dirName(`\file`.byChar).array == `\`); in version()
648 assert(dirName(`\`.byChar).array == `\`); in version()
649 assert(dirName(`\\\`.byChar).array == `\`); in version()
650 assert(dirName(`d:`.byChar).array == `d:`); in version()
651 assert(dirName(`d:file`.byChar).array == `d:`); in version()
652 assert(dirName(`d:\`.byChar).array == `d:\`); in version()
653 assert(dirName(`d:\file`.byChar).array == `d:\`); in version()
654 assert(dirName(`d:\dir\file`.byChar).array == `d:\dir`); in version()
655 assert(dirName(`\\server\share\dir\file`.byChar).array == `\\server\share\dir`); in version()
656 assert(dirName(`\\server\share\file`) == `\\server\share`); in version()
657 assert(dirName(`\\server\share\`.byChar).array == `\\server\share`); in version()
658 assert(dirName(`\\server\share`.byChar).array == `\\server\share`); in version()
735 assert(rootName("") is null);
736 assert(rootName("foo") is null);
737 assert(rootName("/") == "/");
738 assert(rootName("/foo/bar") == "/");
742 assert(rootName("d:foo") is null); in version()
743 assert(rootName(`d:\foo`) == `d:\`); in version()
744 assert(rootName(`\\server\share\foo`) == `\\server\share`); in version()
745 assert(rootName(`\\server\share`) == `\\server\share`); in version()
751 assert(testAliasedString!rootName("/foo/bar"));
754 assert(S.a.rootName == "/");
757 assert(sa.rootName == "/");
765 assert(rootName("".byChar).array == "");
766 assert(rootName("foo".byChar).array == "");
767 assert(rootName("/".byChar).array == "/");
768 assert(rootName("/foo/bar".byChar).array == "/");
772 assert(rootName("d:foo".byChar).array == ""); in version()
773 assert(rootName(`d:\foo`.byChar).array == `d:\`); in version()
774 assert(rootName(`\\server\share\foo`.byChar).array == `\\server\share`); in version()
775 assert(rootName(`\\server\share`.byChar).array == `\\server\share`); in version()
801 else static assert(0, "unsupported platform"); in _rootName()
803 assert(!isRooted(path)); in _rootName()
841 version (Posix) assert(driveName("c:/foo").empty);
844 assert(driveName(`dir\file`).empty); in version()
845 assert(driveName(`d:file`) == "d:"); in version()
846 assert(driveName(`d:\file`) == "d:"); in version()
847 assert(driveName("d:") == "d:"); in version()
848 assert(driveName(`\\server\share\file`) == `\\server\share`); in version()
849 assert(driveName(`\\server\share\`) == `\\server\share`); in version()
850 assert(driveName(`\\server\share`) == `\\server\share`); in version()
852 static assert(driveName(`d:\file`) == "d:"); in version()
858 assert(testAliasedString!driveName("d:/file"));
866 assert(S.a.driveName == result);
869 assert(sa.driveName == result);
877 version (Posix) assert(driveName("c:/foo".byChar).empty);
880 assert(driveName(`dir\file`.byChar).empty); in version()
881 assert(driveName(`d:file`.byChar).array == "d:"); in version()
882 assert(driveName(`d:\file`.byChar).array == "d:"); in version()
883 assert(driveName("d:".byChar).array == "d:"); in version()
884 assert(driveName(`\\server\share\file`.byChar).array == `\\server\share`); in version()
885 assert(driveName(`\\server\share\`.byChar).array == `\\server\share`); in version()
886 assert(driveName(`\\server\share`.byChar).array == `\\server\share`); in version()
888 static assert(driveName(`d:\file`).array == "d:"); in version()
933 assert(stripDrive(`d:\dir\file`) == `\dir\file`); in version()
934 assert(stripDrive(`\\server\share\dir\file`) == `\dir\file`); in version()
940 assert(testAliasedString!stripDrive("d:/dir/file"));
948 assert(S.a.stripDrive == result);
951 assert(sa.stripDrive == result);
958 assert(stripDrive(`d:\dir\file`) == `\dir\file`); in version()
959 assert(stripDrive(`\\server\share\dir\file`) == `\dir\file`); in version()
960 static assert(stripDrive(`d:\dir\file`) == `\dir\file`); in version()
965 assert(s[i] == c); in version()
969 assert(stripDrive(`d:\dir\file`) == `d:\dir\file`); in version()
974 assert(s[i] == c); in version()
1011 assert(extSeparatorPos("file") == -1);
1012 assert(extSeparatorPos("file.ext"w) == 4);
1013 assert(extSeparatorPos("file.ext1.ext2"d) == 9);
1014 assert(extSeparatorPos(".foo".dup) == -1);
1015 assert(extSeparatorPos(".foo.ext"w.dup) == 4);
1020 assert(extSeparatorPos("dir/file"d.dup) == -1);
1021 assert(extSeparatorPos("dir/file.ext") == 8);
1022 assert(extSeparatorPos("dir/file.ext1.ext2"w) == 13);
1023 assert(extSeparatorPos("dir/.foo"d) == -1);
1024 assert(extSeparatorPos("dir/.foo.ext".dup) == 8);
1028 assert(extSeparatorPos("dir\\file") == -1); in version()
1029 assert(extSeparatorPos("dir\\file.ext") == 8); in version()
1030 assert(extSeparatorPos("dir\\file.ext1.ext2") == 13); in version()
1031 assert(extSeparatorPos("dir\\.foo") == -1); in version()
1032 assert(extSeparatorPos("dir\\.foo.ext") == 8); in version()
1034 assert(extSeparatorPos("d:file") == -1); in version()
1035 assert(extSeparatorPos("d:file.ext") == 6); in version()
1036 assert(extSeparatorPos("d:file.ext1.ext2") == 11); in version()
1037 assert(extSeparatorPos("d:.foo") == -1); in version()
1038 assert(extSeparatorPos("d:.foo.ext") == 6); in version()
1041 static assert(extSeparatorPos("file") == -1);
1042 static assert(extSeparatorPos("file.ext"w) == 4);
1071 assert(extension("file").empty);
1072 assert(extension("file.") == ".");
1073 assert(extension("file.ext"w) == ".ext");
1074 assert(extension("file.ext1.ext2"d) == ".ext2");
1075 assert(extension(".foo".dup).empty);
1076 assert(extension(".foo.ext"w.dup) == ".ext");
1078 static assert(extension("file").empty);
1079 static assert(extension("file.ext") == ".ext");
1088 assert(s[i] == c);
1092 assert(extension(DirEntry("file")).empty);
1120 assert(stripExtension("file") == "file");
1121 assert(stripExtension("file.ext") == "file");
1122 assert(stripExtension("file.ext1.ext2") == "file.ext1");
1123 assert(stripExtension("file.") == "file");
1124 assert(stripExtension(".file") == ".file");
1125 assert(stripExtension(".file.ext") == ".file");
1126 assert(stripExtension("dir/file.ext") == "dir/file");
1131 assert(testAliasedString!stripExtension("file"));
1134 assert(S.a.stripExtension == "foo");
1137 assert(sa.stripExtension == "foo");
1142 assert(stripExtension("file.ext"w) == "file");
1143 assert(stripExtension("file.ext1.ext2"d) == "file.ext1");
1148 assert(stripExtension("file".byChar).array == "file");
1149 assert(stripExtension("file.ext"w.byWchar).array == "file");
1150 assert(stripExtension("file.ext1.ext2"d.byDchar).array == "file.ext1");
1192 assert(0); in catch()
1210 assert(0); in catch()
1217 assert(setExtension("file", "ext") == "file.ext");
1218 assert(setExtension("file"w, ".ext"w) == "file.ext");
1219 assert(setExtension("file."d, "ext"d) == "file.ext");
1220 assert(setExtension("file.", ".ext") == "file.ext");
1221 assert(setExtension("file.old"w, "new"w) == "file.new");
1222 assert(setExtension("file.old"d, ".new"d) == "file.new");
1227 assert(setExtension("file"w.dup, "ext"w) == "file.ext");
1228 assert(setExtension("file"w.dup, ".ext"w) == "file.ext");
1229 assert(setExtension("file."w, "ext"w.dup) == "file.ext");
1230 assert(setExtension("file."w, ".ext"w.dup) == "file.ext");
1231 assert(setExtension("file.old"d.dup, "new"d) == "file.new");
1232 assert(setExtension("file.old"d.dup, ".new"d) == "file.new");
1234 static assert(setExtension("file", "ext") == "file.ext");
1235 static assert(setExtension("file.old", "new") == "file.new");
1237 static assert(setExtension("file"w.dup, "ext"w) == "file.ext");
1238 static assert(setExtension("file.old"d.dup, "new"d) == "file.new");
1241 assert(setExtension("file", "") == "file");
1242 assert(setExtension("file.ext", "") == "file");
1275 assert(withExtension("file", "ext").array == "file.ext");
1276 assert(withExtension("file"w, ".ext"w).array == "file.ext");
1277 assert(withExtension("file.ext"w, ".").array == "file.");
1280 assert(withExtension("file".byChar, "ext").array == "file.ext");
1281 assert(withExtension("file"w.byWchar, ".ext"w).array == "file.ext"w);
1282 assert(withExtension("file.ext"w.byWchar, ".").array == "file."w);
1289 assert(testAliasedString!withExtension("file", "ext"));
1292 assert(equal(S.a.withExtension(".txt"), "foo.txt"));
1295 assert(equal(sa.withExtension(".txt"), "foo.txt"));
1332 assert(defaultExtension("file", "ext") == "file.ext");
1333 assert(defaultExtension("file", ".ext") == "file.ext");
1334 assert(defaultExtension("file.", "ext") == "file.");
1335 assert(defaultExtension("file.old", "new") == "file.old");
1336 assert(defaultExtension("file.old", ".new") == "file.old");
1341 assert(defaultExtension("file"w.dup, "ext"w) == "file.ext");
1342 assert(defaultExtension("file.old"d.dup, "new"d) == "file.old");
1344 static assert(defaultExtension("file", "ext") == "file.ext");
1345 static assert(defaultExtension("file.old", "new") == "file.old");
1347 static assert(defaultExtension("file"w.dup, "ext"w) == "file.ext");
1348 static assert(defaultExtension("file.old"d.dup, "new"d) == "file.old");
1379 assert(withDefaultExtension("file", "ext").array == "file.ext");
1380 assert(withDefaultExtension("file"w, ".ext").array == "file.ext"w);
1381 assert(withDefaultExtension("file.", "ext").array == "file.");
1382 assert(withDefaultExtension("file", "").array == "file.");
1385 assert(withDefaultExtension("file".byChar, "ext").array == "file.ext");
1386 assert(withDefaultExtension("file"w.byWchar, ".ext").array == "file.ext"w);
1387 assert(withDefaultExtension("file.".byChar, "ext"d).array == "file.");
1388 assert(withDefaultExtension("file".byChar, "").array == "file.");
1395 assert(testAliasedString!withDefaultExtension("file", "ext"));
1398 assert(equal(S.a.withDefaultExtension(".txt"), "foo.txt"));
1401 assert(equal(sa.withDefaultExtension(".txt"), "foo.txt"));
1502 assert(buildPath("foo", "bar", "baz") == "foo/bar/baz"); in version()
1503 assert(buildPath("/foo/", "bar/baz") == "/foo/bar/baz"); in version()
1504 assert(buildPath("/foo", "/bar") == "/bar"); in version()
1509 assert(buildPath("foo", "bar", "baz") == `foo\bar\baz`); in version()
1510 assert(buildPath(`c:\foo`, `bar\baz`) == `c:\foo\bar\baz`); in version()
1511 assert(buildPath("foo", `d:\bar`) == `d:\bar`); in version()
1512 assert(buildPath("foo", `\bar`) == `\bar`); in version()
1513 assert(buildPath(`c:\foo`, `\bar`) == `c:\bar`); in version()
1525 assert(buildPath("foo") == "foo"); in version()
1526 assert(buildPath("/foo/") == "/foo/"); in version()
1527 assert(buildPath("foo", "bar") == "foo/bar"); in version()
1528 assert(buildPath("foo", "bar", "baz") == "foo/bar/baz"); in version()
1529 assert(buildPath("foo/".dup, "bar") == "foo/bar"); in version()
1530 assert(buildPath("foo///", "bar".dup) == "foo///bar"); in version()
1531 assert(buildPath("/foo"w, "bar"w) == "/foo/bar"); in version()
1532 assert(buildPath("foo"w.dup, "/bar"w) == "/bar"); in version()
1533 assert(buildPath("foo"w, "bar/"w.dup) == "foo/bar/"); in version()
1534 assert(buildPath("/"d, "foo"d) == "/foo"); in version()
1535 assert(buildPath(""d.dup, "foo"d) == "foo"); in version()
1536 assert(buildPath("foo"d, ""d.dup) == "foo"); in version()
1537 assert(buildPath("foo", "bar".dup, "baz") == "foo/bar/baz"); in version()
1538 assert(buildPath("foo"w, "/bar"w, "baz"w.dup) == "/bar/baz"); in version()
1540 static assert(buildPath("foo", "bar", "baz") == "foo/bar/baz"); in version()
1541 static assert(buildPath("foo", "/bar", "baz") == "/bar/baz"); in version()
1545 assert(buildPath(ir("foo")) == "foo"); in version()
1546 assert(buildPath(ir("/foo/")) == "/foo/"); in version()
1547 assert(buildPath(ir("foo", "bar")) == "foo/bar"); in version()
1548 assert(buildPath(ir("foo", "bar", "baz")) == "foo/bar/baz"); in version()
1549 assert(buildPath(ir("foo/".dup, "bar".dup)) == "foo/bar"); in version()
1550 assert(buildPath(ir("foo///".dup, "bar".dup)) == "foo///bar"); in version()
1551 assert(buildPath(ir("/foo"w, "bar"w)) == "/foo/bar"); in version()
1552 assert(buildPath(ir("foo"w.dup, "/bar"w.dup)) == "/bar"); in version()
1553 assert(buildPath(ir("foo"w.dup, "bar/"w.dup)) == "foo/bar/"); in version()
1554 assert(buildPath(ir("/"d, "foo"d)) == "/foo"); in version()
1555 assert(buildPath(ir(""d.dup, "foo"d.dup)) == "foo"); in version()
1556 assert(buildPath(ir("foo"d, ""d)) == "foo"); in version()
1557 assert(buildPath(ir("foo", "bar", "baz")) == "foo/bar/baz"); in version()
1558 assert(buildPath(ir("foo"w.dup, "/bar"w.dup, "baz"w.dup)) == "/bar/baz"); in version()
1562 assert(buildPath("foo") == "foo"); in version()
1563 assert(buildPath(`\foo/`) == `\foo/`); in version()
1564 assert(buildPath("foo", "bar", "baz") == `foo\bar\baz`); in version()
1565 assert(buildPath("foo", `\bar`) == `\bar`); in version()
1566 assert(buildPath(`c:\foo`, "bar") == `c:\foo\bar`); in version()
1567 assert(buildPath("foo"w, `d:\bar`w.dup) == `d:\bar`); in version()
1568 assert(buildPath(`c:\foo\bar`, `\baz`) == `c:\baz`); in version()
1569 assert(buildPath(`\\foo\bar\baz`d, `foo`d, `\bar`d) == `\\foo\bar\bar`d); in version()
1571 static assert(buildPath("foo", "bar", "baz") == `foo\bar\baz`); in version()
1572 static assert(buildPath("foo", `c:\bar`, "baz") == `c:\bar\baz`); in version()
1574 assert(buildPath(ir("foo")) == "foo"); in version()
1575 assert(buildPath(ir(`\foo/`)) == `\foo/`); in version()
1576 assert(buildPath(ir("foo", "bar", "baz")) == `foo\bar\baz`); in version()
1577 assert(buildPath(ir("foo", `\bar`)) == `\bar`); in version()
1578 assert(buildPath(ir(`c:\foo`, "bar")) == `c:\foo\bar`); in version()
1579 assert(buildPath(ir("foo"w.dup, `d:\bar`w.dup)) == `d:\bar`); in version()
1580 assert(buildPath(ir(`c:\foo\bar`, `\baz`)) == `c:\baz`); in version()
1581 assert(buildPath(ir(`\\foo\bar\baz`d, `foo`d, `\bar`d)) == `\\foo\bar\bar`d); in version()
1587 assert(buildPath(manyShort) == manyShortCombined);
1588 assert(buildPath(ir(manyShort)) == manyShortCombined);
1592 assert(buildPath(fewLong) == fewLongCombined);
1593 assert(buildPath(ir(fewLong)) == fewLongCombined);
1602 assert(buildPath(ary) == "a/b"); in version()
1606 assert(buildPath(ary) == `a\b`); in version()
1669 static assert(0);
1687 assert(chainPath("foo", "bar", "baz").array == "foo/bar/baz"); in version()
1688 assert(chainPath("/foo/", "bar/baz").array == "/foo/bar/baz"); in version()
1689 assert(chainPath("/foo", "/bar").array == "/bar"); in version()
1694 assert(chainPath("foo", "bar", "baz").array == `foo\bar\baz`); in version()
1695 assert(chainPath(`c:\foo`, `bar\baz`).array == `c:\foo\bar\baz`); in version()
1696 assert(chainPath("foo", `d:\bar`).array == `d:\bar`); in version()
1697 assert(chainPath("foo", `\bar`).array == `\bar`); in version()
1698 assert(chainPath(`c:\foo`, `\bar`).array == `c:\bar`); in version()
1704 assert(chainPath("foo", "bar", "baz").array == "foo/bar/baz"); in version()
1705 assert(chainPath("/foo/".byChar, "bar/baz").array == "/foo/bar/baz"); in version()
1706 assert(chainPath("/foo", "/bar".byChar).array == "/bar"); in version()
1711 assert(chainPath("foo", "bar", "baz").array == `foo\bar\baz`); in version()
1712 assert(chainPath(`c:\foo`.byChar, `bar\baz`).array == `c:\foo\bar\baz`); in version()
1713 assert(chainPath("foo", `d:\bar`).array == `d:\bar`); in version()
1714 assert(chainPath("foo", `\bar`.byChar).array == `\bar`); in version()
1715 assert(chainPath(`c:\foo`, `\bar`w).array == `c:\bar`); in version()
1730 …assert(chainPath(TestAliasedString(null), TestAliasedString(null), TestAliasedString(null)).empty);
1731 assert(chainPath(TestAliasedString(null), TestAliasedString(null), "").empty);
1732 assert(chainPath(TestAliasedString(null), "", TestAliasedString(null)).empty);
1734 …static assert(!__traits(compiles, chainPath(TestAliasedString(null), S(""), TestAliasedString(null…
1779 assert(buildNormalizedPath("foo", "..") == ".");
1783 assert(buildNormalizedPath("/foo/./bar/..//baz/") == "/foo/baz"); in version()
1784 assert(buildNormalizedPath("../foo/.") == "../foo"); in version()
1785 assert(buildNormalizedPath("/foo", "bar/baz/") == "/foo/bar/baz"); in version()
1786 assert(buildNormalizedPath("/foo", "/bar/..", "baz") == "/baz"); in version()
1787 assert(buildNormalizedPath("foo/./bar", "../../", "../baz") == "../baz"); in version()
1788 assert(buildNormalizedPath("/foo/./bar", "../../baz") == "/baz"); in version()
1793 assert(buildNormalizedPath(`c:\foo\.\bar/..\\baz\`) == `c:\foo\baz`); in version()
1794 assert(buildNormalizedPath(`..\foo\.`) == `..\foo`); in version()
1795 assert(buildNormalizedPath(`c:\foo`, `bar\baz\`) == `c:\foo\bar\baz`); in version()
1796 assert(buildNormalizedPath(`c:\foo`, `bar/..`) == `c:\foo`); in version()
1797 assert(buildNormalizedPath(`\\server\share\foo`, `..\bar`) == in version()
1804 assert(buildNormalizedPath(".", ".") == ".");
1805 assert(buildNormalizedPath("foo", "..") == ".");
1806 assert(buildNormalizedPath("", "") is null);
1807 assert(buildNormalizedPath("", ".") == ".");
1808 assert(buildNormalizedPath(".", "") == ".");
1809 assert(buildNormalizedPath(null, "foo") == "foo");
1810 assert(buildNormalizedPath("", "foo") == "foo");
1811 assert(buildNormalizedPath("", "") == "");
1812 assert(buildNormalizedPath("", null) == "");
1813 assert(buildNormalizedPath(null, "") == "");
1814 assert(buildNormalizedPath!(char)(null, null) == "");
1818 assert(buildNormalizedPath("/", "foo", "bar") == "/foo/bar"); in version()
1819 assert(buildNormalizedPath("foo", "bar", "baz") == "foo/bar/baz"); in version()
1820 assert(buildNormalizedPath("foo", "bar/baz") == "foo/bar/baz"); in version()
1821 assert(buildNormalizedPath("foo", "bar//baz///") == "foo/bar/baz"); in version()
1822 assert(buildNormalizedPath("/foo", "bar/baz") == "/foo/bar/baz"); in version()
1823 assert(buildNormalizedPath("/foo", "/bar/baz") == "/bar/baz"); in version()
1824 assert(buildNormalizedPath("/foo/..", "/bar/./baz") == "/bar/baz"); in version()
1825 assert(buildNormalizedPath("/foo/..", "bar/baz") == "/bar/baz"); in version()
1826 assert(buildNormalizedPath("/foo/../../", "bar/baz") == "/bar/baz"); in version()
1827 assert(buildNormalizedPath("/foo/bar", "../baz") == "/foo/baz"); in version()
1828 assert(buildNormalizedPath("/foo/bar", "../../baz") == "/baz"); in version()
1829 assert(buildNormalizedPath("/foo/bar", ".././/baz/..", "wee/") == "/foo/wee"); in version()
1830 assert(buildNormalizedPath("//foo/bar", "baz///wee") == "/foo/bar/baz/wee"); in version()
1831 static assert(buildNormalizedPath("/foo/..", "/bar/./baz") == "/bar/baz"); in version()
1835 assert(buildNormalizedPath(`\`, `foo`, `bar`) == `\foo\bar`); in version()
1836 assert(buildNormalizedPath(`foo`, `bar`, `baz`) == `foo\bar\baz`); in version()
1837 assert(buildNormalizedPath(`foo`, `bar\baz`) == `foo\bar\baz`); in version()
1838 assert(buildNormalizedPath(`foo`, `bar\\baz\\\`) == `foo\bar\baz`); in version()
1839 assert(buildNormalizedPath(`\foo`, `bar\baz`) == `\foo\bar\baz`); in version()
1840 assert(buildNormalizedPath(`\foo`, `\bar\baz`) == `\bar\baz`); in version()
1841 assert(buildNormalizedPath(`\foo\..`, `\bar\.\baz`) == `\bar\baz`); in version()
1842 assert(buildNormalizedPath(`\foo\..`, `bar\baz`) == `\bar\baz`); in version()
1843 assert(buildNormalizedPath(`\foo\..\..\`, `bar\baz`) == `\bar\baz`); in version()
1844 assert(buildNormalizedPath(`\foo\bar`, `..\baz`) == `\foo\baz`); in version()
1845 assert(buildNormalizedPath(`\foo\bar`, `../../baz`) == `\baz`); in version()
1846 assert(buildNormalizedPath(`\foo\bar`, `..\.\/baz\..`, `wee\`) == `\foo\wee`); in version()
1848 assert(buildNormalizedPath(`c:\`, `foo`, `bar`) == `c:\foo\bar`); in version()
1849 assert(buildNormalizedPath(`c:foo`, `bar`, `baz`) == `c:foo\bar\baz`); in version()
1850 assert(buildNormalizedPath(`c:foo`, `bar\baz`) == `c:foo\bar\baz`); in version()
1851 assert(buildNormalizedPath(`c:foo`, `bar\\baz\\\`) == `c:foo\bar\baz`); in version()
1852 assert(buildNormalizedPath(`c:\foo`, `bar\baz`) == `c:\foo\bar\baz`); in version()
1853 assert(buildNormalizedPath(`c:\foo`, `\bar\baz`) == `c:\bar\baz`); in version()
1854 assert(buildNormalizedPath(`c:\foo\..`, `\bar\.\baz`) == `c:\bar\baz`); in version()
1855 assert(buildNormalizedPath(`c:\foo\..`, `bar\baz`) == `c:\bar\baz`); in version()
1856 assert(buildNormalizedPath(`c:\foo\..\..\`, `bar\baz`) == `c:\bar\baz`); in version()
1857 assert(buildNormalizedPath(`c:\foo\bar`, `..\baz`) == `c:\foo\baz`); in version()
1858 assert(buildNormalizedPath(`c:\foo\bar`, `..\..\baz`) == `c:\baz`); in version()
1859 assert(buildNormalizedPath(`c:\foo\bar`, `..\.\\baz\..`, `wee\`) == `c:\foo\wee`); in version()
1861 assert(buildNormalizedPath(`\\server\share`, `foo`, `bar`) == `\\server\share\foo\bar`); in version()
1862 assert(buildNormalizedPath(`\\server\share\`, `foo`, `bar`) == `\\server\share\foo\bar`); in version()
1863 … assert(buildNormalizedPath(`\\server\share\foo`, `bar\baz`) == `\\server\share\foo\bar\baz`); in version()
1864 assert(buildNormalizedPath(`\\server\share\foo`, `\bar\baz`) == `\\server\share\bar\baz`); in version()
1865 … assert(buildNormalizedPath(`\\server\share\foo\..`, `\bar\.\baz`) == `\\server\share\bar\baz`); in version()
1866 assert(buildNormalizedPath(`\\server\share\foo\..`, `bar\baz`) == `\\server\share\bar\baz`); in version()
1867 … assert(buildNormalizedPath(`\\server\share\foo\..\..\`, `bar\baz`) == `\\server\share\bar\baz`); in version()
1868 assert(buildNormalizedPath(`\\server\share\foo\bar`, `..\baz`) == `\\server\share\foo\baz`); in version()
1869 assert(buildNormalizedPath(`\\server\share\foo\bar`, `..\..\baz`) == `\\server\share\baz`); in version()
1870 …assert(buildNormalizedPath(`\\server\share\foo\bar`, `..\.\\baz\..`, `wee\`) == `\\server\share\fo… in version()
1872 static assert(buildNormalizedPath(`\foo\..\..\`, `bar\baz`) == `\bar\baz`); in version()
1874 else static assert(0);
1883 assert(buildNormalizedPath(ary) == "a/b"); in version()
1887 assert(buildNormalizedPath(ary) == `a\b`); in version()
1981 static assert(dirSeparator.length == 1); in popFront()
2058 assert(asNormalizedPath("foo/..").array == ".");
2062 assert(asNormalizedPath("/foo/./bar/..//baz/").array == "/foo/baz"); in version()
2063 assert(asNormalizedPath("../foo/.").array == "../foo"); in version()
2064 assert(asNormalizedPath("/foo/bar/baz/").array == "/foo/bar/baz"); in version()
2065 assert(asNormalizedPath("/foo/./bar/../../baz").array == "/baz"); in version()
2070 assert(asNormalizedPath(`c:\foo\.\bar/..\\baz\`).array == `c:\foo\baz`); in version()
2071 assert(asNormalizedPath(`..\foo\.`).array == `..\foo`); in version()
2072 assert(asNormalizedPath(`c:\foo\bar\baz\`).array == `c:\foo\bar\baz`); in version()
2073 assert(asNormalizedPath(`c:\foo\bar/..`).array == `c:\foo`); in version()
2074 assert(asNormalizedPath(`\\server\share\foo\..\bar`).array == in version()
2087 assert(testAliasedString!asNormalizedPath(null));
2095 assert(asNormalizedPath("").array is null);
2096 assert(asNormalizedPath("foo").array == "foo");
2097 assert(asNormalizedPath(".").array == ".");
2098 assert(asNormalizedPath("./.").array == ".");
2099 assert(asNormalizedPath("foo/..").array == ".");
2103 assert(save.front == 'o');
2107 assert(asNormalizedPath("/foo/bar").array == "/foo/bar"); in version()
2108 assert(asNormalizedPath("foo/bar/baz").array == "foo/bar/baz"); in version()
2109 assert(asNormalizedPath("foo/bar/baz").array == "foo/bar/baz"); in version()
2110 assert(asNormalizedPath("foo/bar//baz///").array == "foo/bar/baz"); in version()
2111 assert(asNormalizedPath("/foo/bar/baz").array == "/foo/bar/baz"); in version()
2112 assert(asNormalizedPath("/foo/../bar/baz").array == "/bar/baz"); in version()
2113 assert(asNormalizedPath("/foo/../..//bar/baz").array == "/bar/baz"); in version()
2114 assert(asNormalizedPath("/foo/bar/../baz").array == "/foo/baz"); in version()
2115 assert(asNormalizedPath("/foo/bar/../../baz").array == "/baz"); in version()
2116 assert(asNormalizedPath("/foo/bar/.././/baz/../wee/").array == "/foo/wee"); in version()
2117 assert(asNormalizedPath("//foo/bar/baz///wee").array == "/foo/bar/baz/wee"); in version()
2119 assert(asNormalizedPath("foo//bar").array == "foo/bar"); in version()
2120 assert(asNormalizedPath("foo/bar").array == "foo/bar"); in version()
2123 assert(asNormalizedPath("./").array == "."); in version()
2124 assert(asNormalizedPath("././").array == "."); in version()
2125 assert(asNormalizedPath("./foo/..").array == "."); in version()
2126 assert(asNormalizedPath("foo/..").array == "."); in version()
2130 assert(asNormalizedPath(`\foo\bar`).array == `\foo\bar`); in version()
2131 assert(asNormalizedPath(`foo\bar\baz`).array == `foo\bar\baz`); in version()
2132 assert(asNormalizedPath(`foo\bar\baz`).array == `foo\bar\baz`); in version()
2133 assert(asNormalizedPath(`foo\bar\\baz\\\`).array == `foo\bar\baz`); in version()
2134 assert(asNormalizedPath(`\foo\bar\baz`).array == `\foo\bar\baz`); in version()
2135 assert(asNormalizedPath(`\foo\..\\bar\.\baz`).array == `\bar\baz`); in version()
2136 assert(asNormalizedPath(`\foo\..\bar\baz`).array == `\bar\baz`); in version()
2137 assert(asNormalizedPath(`\foo\..\..\\bar\baz`).array == `\bar\baz`); in version()
2139 assert(asNormalizedPath(`\foo\bar\..\baz`).array == `\foo\baz`); in version()
2140 assert(asNormalizedPath(`\foo\bar\../../baz`).array == `\baz`); in version()
2141 assert(asNormalizedPath(`\foo\bar\..\.\/baz\..\wee\`).array == `\foo\wee`); in version()
2143 assert(asNormalizedPath(`c:\foo\bar`).array == `c:\foo\bar`); in version()
2144 assert(asNormalizedPath(`c:foo\bar\baz`).array == `c:foo\bar\baz`); in version()
2145 assert(asNormalizedPath(`c:foo\bar\baz`).array == `c:foo\bar\baz`); in version()
2146 assert(asNormalizedPath(`c:foo\bar\\baz\\\`).array == `c:foo\bar\baz`); in version()
2147 assert(asNormalizedPath(`c:\foo\bar\baz`).array == `c:\foo\bar\baz`); in version()
2149 assert(asNormalizedPath(`c:\foo\..\\bar\.\baz`).array == `c:\bar\baz`); in version()
2150 assert(asNormalizedPath(`c:\foo\..\bar\baz`).array == `c:\bar\baz`); in version()
2151 assert(asNormalizedPath(`c:\foo\..\..\\bar\baz`).array == `c:\bar\baz`); in version()
2152 assert(asNormalizedPath(`c:\foo\bar\..\baz`).array == `c:\foo\baz`); in version()
2153 assert(asNormalizedPath(`c:\foo\bar\..\..\baz`).array == `c:\baz`); in version()
2154 assert(asNormalizedPath(`c:\foo\bar\..\.\\baz\..\wee\`).array == `c:\foo\wee`); in version()
2155 assert(asNormalizedPath(`\\server\share\foo\bar`).array == `\\server\share\foo\bar`); in version()
2156 assert(asNormalizedPath(`\\server\share\\foo\bar`).array == `\\server\share\foo\bar`); in version()
2157 … assert(asNormalizedPath(`\\server\share\foo\bar\baz`).array == `\\server\share\foo\bar\baz`); in version()
2158 … assert(asNormalizedPath(`\\server\share\foo\..\\bar\.\baz`).array == `\\server\share\bar\baz`); in version()
2159 assert(asNormalizedPath(`\\server\share\foo\..\bar\baz`).array == `\\server\share\bar\baz`); in version()
2160 … assert(asNormalizedPath(`\\server\share\foo\..\..\\bar\baz`).array == `\\server\share\bar\baz`); in version()
2161 assert(asNormalizedPath(`\\server\share\foo\bar\..\baz`).array == `\\server\share\foo\baz`); in version()
2162 assert(asNormalizedPath(`\\server\share\foo\bar\..\..\baz`).array == `\\server\share\baz`); in version()
2163 …assert(asNormalizedPath(`\\server\share\foo\bar\..\.\\baz\..\wee\`).array == `\\server\share\foo\w… in version()
2165 static assert(asNormalizedPath(`\foo\..\..\\bar\baz`).array == `\bar\baz`); in version()
2167 assert(asNormalizedPath("foo//bar").array == `foo\bar`); in version()
2170 assert(asNormalizedPath(`.\`).array == "."); in version()
2171 assert(asNormalizedPath(`.\.\`).array == "."); in version()
2172 assert(asNormalizedPath(`.\foo\..`).array == "."); in version()
2173 assert(asNormalizedPath(`foo\..`).array == "."); in version()
2175 else static assert(0);
2185 assert(asNormalizedPath("").empty); in version()
2186 assert(asNormalizedPath("foo/bar").array == "foo/bar"); in version()
2189 assert(asNormalizedPath("/").array == "/"); in version()
2190 assert(asNormalizedPath("///").array == "/"); in version()
2191 assert(asNormalizedPath("////").array == "/"); in version()
2192 assert(asNormalizedPath("/foo/bar").array == "/foo/bar"); in version()
2193 assert(asNormalizedPath("//foo/bar").array == "/foo/bar"); in version()
2194 assert(asNormalizedPath("///foo/bar").array == "/foo/bar"); in version()
2195 assert(asNormalizedPath("////foo/bar").array == "/foo/bar"); in version()
2198 assert(asNormalizedPath("/./foo").array == "/foo"); in version()
2199 assert(asNormalizedPath("/foo/./bar").array == "/foo/bar"); in version()
2201 assert(asNormalizedPath("./foo").array == "foo"); in version()
2202 assert(asNormalizedPath("././foo").array == "foo"); in version()
2203 assert(asNormalizedPath("foo/././bar").array == "foo/bar"); in version()
2206 assert(asNormalizedPath("/foo/../bar").array == "/bar"); in version()
2207 assert(asNormalizedPath("/foo/../../bar").array == "/bar"); in version()
2208 assert(asNormalizedPath("/../foo").array == "/foo"); in version()
2209 assert(asNormalizedPath("/../../foo").array == "/foo"); in version()
2210 assert(asNormalizedPath("/foo/..").array == "/"); in version()
2211 assert(asNormalizedPath("/foo/../..").array == "/"); in version()
2213 assert(asNormalizedPath("foo/../bar").array == "bar"); in version()
2214 assert(asNormalizedPath("foo/../../bar").array == "../bar"); in version()
2215 assert(asNormalizedPath("../foo").array == "../foo"); in version()
2216 assert(asNormalizedPath("../../foo").array == "../../foo"); in version()
2217 assert(asNormalizedPath("../foo/../bar").array == "../bar"); in version()
2218 assert(asNormalizedPath(".././../foo").array == "../../foo"); in version()
2219 assert(asNormalizedPath("foo/bar/..").array == "foo"); in version()
2220 assert(asNormalizedPath("/foo/../..").array == "/"); in version()
2223 assert(asNormalizedPath("/foo/../bar//./../...///baz//").array == "/.../baz"); in version()
2224 static assert(asNormalizedPath("/foo/../bar//./../...///baz//").array == "/.../baz"); in version()
2229 assert(asNormalizedPath("").empty); in version()
2230 assert(asNormalizedPath(`foo\bar`).array == `foo\bar`); in version()
2231 assert(asNormalizedPath("foo/bar").array == `foo\bar`); in version()
2234 assert(asNormalizedPath("/").array == `\`); in version()
2235 assert(asNormalizedPath(`\`).array == `\`); in version()
2236 assert(asNormalizedPath(`\\\`).array == `\`); in version()
2237 assert(asNormalizedPath(`\\\\`).array == `\`); in version()
2238 assert(asNormalizedPath(`\foo\bar`).array == `\foo\bar`); in version()
2239 assert(asNormalizedPath(`\\foo`).array == `\\foo`); in version()
2240 assert(asNormalizedPath(`\\foo\\`).array == `\\foo`); in version()
2241 assert(asNormalizedPath(`\\foo/bar`).array == `\\foo\bar`); in version()
2242 assert(asNormalizedPath(`\\\foo\bar`).array == `\foo\bar`); in version()
2243 assert(asNormalizedPath(`\\\\foo\bar`).array == `\foo\bar`); in version()
2244 assert(asNormalizedPath(`c:\`).array == `c:\`); in version()
2245 assert(asNormalizedPath(`c:\foo\bar`).array == `c:\foo\bar`); in version()
2246 assert(asNormalizedPath(`c:\\foo\bar`).array == `c:\foo\bar`); in version()
2249 assert(asNormalizedPath(`\./foo`).array == `\foo`); in version()
2250 assert(asNormalizedPath(`\foo/.\bar`).array == `\foo\bar`); in version()
2252 assert(asNormalizedPath(`.\foo`).array == `foo`); in version()
2253 assert(asNormalizedPath(`./.\foo`).array == `foo`); in version()
2254 assert(asNormalizedPath(`foo\.\./bar`).array == `foo\bar`); in version()
2257 assert(asNormalizedPath(`\foo\..\bar`).array == `\bar`); in version()
2258 assert(asNormalizedPath(`\foo\../..\bar`).array == `\bar`); in version()
2259 assert(asNormalizedPath(`\..\foo`).array == `\foo`); in version()
2260 assert(asNormalizedPath(`\..\..\foo`).array == `\foo`); in version()
2261 assert(asNormalizedPath(`\foo\..`).array == `\`); in version()
2262 assert(asNormalizedPath(`\foo\../..`).array == `\`); in version()
2264 assert(asNormalizedPath(`foo\..\bar`).array == `bar`); in version()
2265 assert(asNormalizedPath(`foo\..\../bar`).array == `..\bar`); in version()
2267 assert(asNormalizedPath(`..\foo`).array == `..\foo`); in version()
2268 assert(asNormalizedPath(`..\..\foo`).array == `..\..\foo`); in version()
2269 assert(asNormalizedPath(`..\foo\..\bar`).array == `..\bar`); in version()
2270 assert(asNormalizedPath(`..\.\..\foo`).array == `..\..\foo`); in version()
2271 assert(asNormalizedPath(`foo\bar\..`).array == `foo`); in version()
2272 assert(asNormalizedPath(`\foo\..\..`).array == `\`); in version()
2273 assert(asNormalizedPath(`c:\foo\..\..`).array == `c:\`); in version()
2276 assert(asNormalizedPath(`c:foo`).array == `c:foo`); in version()
2277 assert(asNormalizedPath(`c:..\foo\.\..\bar`).array == `c:..\bar`); in version()
2280 assert(asNormalizedPath(`c:\foo\..\bar\\.\..\...\\\baz\\`).array == `c:\...\baz`); in version()
2281 static assert(asNormalizedPath(`c:\foo\..\bar\\.\..\...\\\baz\\`).array == `c:\...\baz`); in version()
2283 else static assert(false);
2305 assert(!empty); in front()
2311 assert(!empty); in popFront()
2336 assert(!empty); in back()
2342 assert(!empty); in popBack()
2409 assert(!isRooted(_path)); in this()
2426 else static assert(0); in this()
2464 assert(equal(pathSplitter("/"), ["/"]));
2465 assert(equal(pathSplitter("/foo/bar"), ["/", "foo", "bar"]));
2466 assert(equal(pathSplitter("foo/../bar//./"), ["foo", "..", "bar", "."]));
2470 assert(equal(pathSplitter("//foo/bar"), ["/", "foo", "bar"])); in version()
2475 assert(equal(pathSplitter(`foo\..\bar\/.\`), ["foo", "..", "bar", "."])); in version()
2476 assert(equal(pathSplitter("c:"), ["c:"])); in version()
2477 assert(equal(pathSplitter(`c:\foo\bar`), [`c:\`, "foo", "bar"])); in version()
2478 assert(equal(pathSplitter(`c:foo\bar`), ["c:foo", "bar"])); in version()
2491 assert(testAliasedString!pathSplitter("/"));
2502 static assert(isBidirectionalRange!R1); in equal2()
2506 assert(pathSplitter("").empty);
2509 assert(equal2(pathSplitter("/"), ["/"]));
2510 assert(equal2(pathSplitter("//"), ["/"]));
2511 assert(equal2(pathSplitter("///"w), ["/"w]));
2514 assert(equal2(pathSplitter("/foo/bar".dup), ["/", "foo", "bar"]));
2517 assert(equal2(pathSplitter("foo/bar"d.dup), ["foo"d, "bar"d]));
2518 assert(equal2(pathSplitter("foo//bar"), ["foo", "bar"]));
2519 assert(equal2(pathSplitter("foo/bar//"w), ["foo"w, "bar"w]));
2520 assert(equal2(pathSplitter("foo/../bar//./"d), ["foo"d, ".."d, "bar"d, "."d]));
2526 assert(equal2(ps1, ["bar", "baz"]));
2527 assert(equal2(ps2, ["foo", "bar", "baz"]));
2532 assert(equal2(pathSplitter("//foo/bar"w.dup), ["/"w, "foo"w, "bar"w])); in version()
2536 assert(equal2(pathSplitter(`\`), [`\`])); in version()
2537 assert(equal2(pathSplitter(`foo\..\bar\/.\`), ["foo", "..", "bar", "."])); in version()
2538 assert(equal2(pathSplitter("c:"), ["c:"])); in version()
2539 assert(equal2(pathSplitter(`c:\foo\bar`), [`c:\`, "foo", "bar"])); in version()
2540 assert(equal2(pathSplitter(`c:foo\bar`), ["c:foo", "bar"])); in version()
2541 assert(equal2(pathSplitter(`\\foo\bar`), [`\\foo\bar`])); in version()
2542 assert(equal2(pathSplitter(`\\foo\bar\\`), [`\\foo\bar`])); in version()
2543 assert(equal2(pathSplitter(`\\foo\bar\baz`), [`\\foo\bar`, "baz"])); in version()
2549 assert(equal(pathSplitter("/foo/bar".dup), ["/", "foo", "bar"]));
2552 static assert(is(typeof(pathSplitter!(const(char)[])(null).front) == const(char)[]));
2555 assert(equal2(pathSplitter("foo/bar"d.byDchar), ["foo"d, "bar"d]));
2589 assert( isRooted("/")); in version()
2590 assert( isRooted("/foo")); in version()
2591 assert(!isRooted("foo")); in version()
2592 assert(!isRooted("../foo")); in version()
2597 assert( isRooted(`\`)); in version()
2598 assert( isRooted(`\foo`)); in version()
2599 assert( isRooted(`d:\foo`)); in version()
2600 assert( isRooted(`\\foo\bar`)); in version()
2601 assert(!isRooted("foo")); in version()
2602 assert(!isRooted("d:foo")); in version()
2608 assert(isRooted("/"));
2609 assert(isRooted("/foo"));
2610 assert(!isRooted("foo"));
2611 assert(!isRooted("../foo"));
2615 assert(isRooted(`\`)); in version()
2616 assert(isRooted(`\foo`)); in version()
2617 assert(isRooted(`d:\foo`)); in version()
2618 assert(isRooted(`\\foo\bar`)); in version()
2619 assert(!isRooted("foo")); in version()
2620 assert(!isRooted("d:foo")); in version()
2623 static assert(isRooted("/foo"));
2624 static assert(!isRooted("foo"));
2627 assert(!isRooted(DirEntry("foo")));
2688 assert(!isAbsolute("foo"));
2689 assert(!isAbsolute("../foo"w));
2690 static assert(!isAbsolute("foo"));
2694 assert(isAbsolute("/"d)); in version()
2695 assert(isAbsolute("/foo".dup)); in version()
2696 static assert(isAbsolute("/foo")); in version()
2701 assert(isAbsolute("d:\\"w)); in version()
2702 assert(isAbsolute("d:\\foo"d)); in version()
2703 assert(isAbsolute("\\\\foo\\bar")); in version()
2704 assert(!isAbsolute("\\"w.dup)); in version()
2705 assert(!isAbsolute("\\foo"d.dup)); in version()
2706 assert(!isAbsolute("d:")); in version()
2707 assert(!isAbsolute("d:foo")); in version()
2708 static assert(isAbsolute(`d:\foo`)); in version()
2713 assert(!r.isAbsolute());
2717 assert(!isAbsolute(DirEntry("foo")));
2765 assert(absolutePath("some/file", "/foo/bar") == "/foo/bar/some/file"); in version()
2766 assert(absolutePath("../file", "/foo/bar") == "/foo/bar/../file"); in version()
2767 assert(absolutePath("/some/file", "/foo/bar") == "/some/file"); in version()
2772 assert(absolutePath(`some\file`, `c:\foo\bar`) == `c:\foo\bar\some\file`); in version()
2773 assert(absolutePath(`..\file`, `c:\foo\bar`) == `c:\foo\bar\..\file`); in version()
2774 assert(absolutePath(`c:\some\file`, `c:\foo\bar`) == `c:\some\file`); in version()
2775 assert(absolutePath(`\`, `c:\`) == `c:\`); in version()
2776 assert(absolutePath(`\some\file`, `c:\foo\bar`) == `c:\some\file`); in version()
2784 static assert(absolutePath("some/file", "/foo/bar") == "/foo/bar/some/file"); in version()
2789 static assert(absolutePath(`some\file`, `c:\foo\bar`) == `c:\foo\bar\some\file`); in version()
2831 assert(asAbsolutePath(cast(string) null).array == "");
2834 assert(asAbsolutePath("/foo").array == "/foo"); in version()
2838 assert(asAbsolutePath("c:/foo").array == "c:/foo"); in version()
2851 assert(testAliasedString!asAbsolutePath(null));
2910 assert(relativePath("foo") == "foo");
2914 assert(relativePath("foo", "/bar") == "foo"); in version()
2915 assert(relativePath("/foo/bar", "/foo/bar") == "."); in version()
2916 assert(relativePath("/foo/bar", "/foo/baz") == "../bar"); in version()
2917 assert(relativePath("/foo/bar/baz", "/foo/woo/wee") == "../../bar/baz"); in version()
2918 assert(relativePath("/foo/bar/baz", "/foo/bar") == "baz"); in version()
2922 assert(relativePath("foo", `c:\bar`) == "foo"); in version()
2923 assert(relativePath(`c:\foo\bar`, `c:\foo\bar`) == "."); in version()
2924 assert(relativePath(`c:\foo\bar`, `c:\foo\baz`) == `..\bar`); in version()
2925 assert(relativePath(`c:\foo\bar\baz`, `c:\foo\woo\wee`) == `..\..\bar\baz`); in version()
2926 assert(relativePath(`c:\foo\bar\baz`, `c:\foo\bar`) == "baz"); in version()
2927 assert(relativePath(`c:\foo\bar`, `d:\foo`) == `c:\foo\bar`); in version()
2934 assert(relativePath("foo") == "foo");
2938 assert(relativePath("/foo/bar", "/foo/baz") == "../bar"); in version()
2944 assert(relativePath(`c:\foo\bar\baz`, `c:\foo\bar`) == "baz"); in version()
2947 else static assert(0);
3044 assert(asRelativePath("foo", "/bar").array == "foo"); in version()
3045 assert(asRelativePath("/foo/bar", "/foo/bar").array == "."); in version()
3046 assert(asRelativePath("/foo/bar", "/foo/baz").array == "../bar"); in version()
3047 assert(asRelativePath("/foo/bar/baz", "/foo/woo/wee").array == "../../bar/baz"); in version()
3048 assert(asRelativePath("/foo/bar/baz", "/foo/bar").array == "baz"); in version()
3052 assert(asRelativePath("foo", `c:\bar`).array == "foo"); in version()
3053 assert(asRelativePath(`c:\foo\bar`, `c:\foo\bar`).array == "."); in version()
3054 assert(asRelativePath(`c:\foo\bar`, `c:\foo\baz`).array == `..\bar`); in version()
3055 assert(asRelativePath(`c:\foo\bar\baz`, `c:\foo\woo\wee`).array == `..\..\bar\baz`); in version()
3056 assert(asRelativePath(`c:/foo/bar/baz`, `c:\foo\woo\wee`).array == `..\..\bar\baz`); in version()
3057 assert(asRelativePath(`c:\foo\bar\baz`, `c:\foo\bar`).array == "baz"); in version()
3058 assert(asRelativePath(`c:\foo\bar`, `d:\foo`).array == `c:\foo\bar`); in version()
3059 assert(asRelativePath(`\\foo\bar`, `c:\foo`).array == `\\foo\bar`); in version()
3062 static assert(0);
3069 assert(isBidirectionalRange!(typeof(asRelativePath("foo/bar/baz", "/foo/woo/wee")))); in version()
3074 assert(isBidirectionalRange!(typeof(asRelativePath(`c:\foo\bar`, `c:\foo\baz`)))); in version()
3091 assert(asRelativePath(TestAliasedString("foo"), TestAliasedString("/bar")).array == "foo");
3093 … assert(asRelativePath(TestAliasedString("foo"), TestAliasedString(`c:\bar`)).array == "foo");
3094 assert(asRelativePath(TestAliasedString("foo"), "bar").array == "foo");
3095 assert(asRelativePath("foo", TestAliasedString("bar")).array == "foo");
3096 assert(asRelativePath(TestAliasedString("foo"), TestAliasedString("bar")).array == "foo");
3098 assert(asRelativePath("foo"d.byDchar, TestAliasedString("bar")).array == "foo");
3106 assert(asRelativePath("/foo/bar/baz".bCU, "/foo/bar".bCU).array == "baz"); in version()
3107 assert(asRelativePath("/foo/bar/baz"w.bCU, "/foo/bar"w.bCU).array == "baz"w); in version()
3108 assert(asRelativePath("/foo/bar/baz"d.bCU, "/foo/bar"d.bCU).array == "baz"d); in version()
3112 assert(asRelativePath(`\\foo\bar`.bCU, `c:\foo`.bCU).array == `\\foo\bar`); in version()
3113 assert(asRelativePath(`\\foo\bar`w.bCU, `c:\foo`w.bCU).array == `\\foo\bar`w); in version()
3114 assert(asRelativePath(`\\foo\bar`d.bCU, `c:\foo`d.bCU).array == `\\foo\bar`d); in version()
3153 assert(filenameCharCmp('a', 'a') == 0);
3154 assert(filenameCharCmp('a', 'b') < 0);
3155 assert(filenameCharCmp('b', 'a') > 0);
3160 assert(filenameCharCmp('A', 'a') < 0); in version()
3161 assert(filenameCharCmp('a', 'A') > 0); in version()
3166 assert(filenameCharCmp('a', 'A') == 0); in version()
3167 assert(filenameCharCmp('a', 'B') < 0); in version()
3168 assert(filenameCharCmp('A', 'b') < 0); in version()
3174 assert(filenameCharCmp!(CaseSensitive.yes)('A', 'a') < 0);
3175 assert(filenameCharCmp!(CaseSensitive.yes)('a', 'A') > 0);
3177 assert(filenameCharCmp!(CaseSensitive.no)('a', 'a') == 0);
3178 assert(filenameCharCmp!(CaseSensitive.no)('a', 'b') < 0);
3179 assert(filenameCharCmp!(CaseSensitive.no)('b', 'a') > 0);
3180 assert(filenameCharCmp!(CaseSensitive.no)('A', 'a') == 0);
3181 assert(filenameCharCmp!(CaseSensitive.no)('a', 'A') == 0);
3182 assert(filenameCharCmp!(CaseSensitive.no)('a', 'B') < 0);
3183 assert(filenameCharCmp!(CaseSensitive.no)('B', 'a') > 0);
3184 assert(filenameCharCmp!(CaseSensitive.no)('A', 'b') < 0);
3185 assert(filenameCharCmp!(CaseSensitive.no)('b', 'A') > 0);
3187 version (Posix) assert(filenameCharCmp('\\', '/') != 0);
3188 version (Windows) assert(filenameCharCmp('\\', '/') == 0);
3253 assert(filenameCmp("abc", "abc") == 0);
3254 assert(filenameCmp("abc", "abd") < 0);
3255 assert(filenameCmp("abc", "abb") > 0);
3256 assert(filenameCmp("abc", "abcd") < 0);
3257 assert(filenameCmp("abcd", "abc") > 0);
3262 assert(filenameCmp("Abc", "abc") < 0); in version()
3263 assert(filenameCmp("abc", "Abc") > 0); in version()
3268 assert(filenameCmp("Abc", "abc") == 0); in version()
3269 assert(filenameCmp("abc", "Abc") == 0); in version()
3270 assert(filenameCmp("Abc", "abD") < 0); in version()
3271 assert(filenameCmp("abc", "AbB") > 0); in version()
3286 assert(filenameCmp!(CaseSensitive.yes)(TestAliasedString("Abc"), "abc") < 0);
3287 assert(filenameCmp!(CaseSensitive.yes)("Abc", TestAliasedString("abc")) < 0);
3288 assert(filenameCmp!(CaseSensitive.yes)(TestAliasedString("Abc"), TestAliasedString("abc")) < 0);
3293 assert(filenameCmp!(CaseSensitive.yes)("Abc", "abc") < 0);
3294 assert(filenameCmp!(CaseSensitive.yes)("abc", "Abc") > 0);
3296 assert(filenameCmp!(CaseSensitive.no)("abc", "abc") == 0);
3297 assert(filenameCmp!(CaseSensitive.no)("abc", "abd") < 0);
3298 assert(filenameCmp!(CaseSensitive.no)("abc", "abb") > 0);
3299 assert(filenameCmp!(CaseSensitive.no)("abc", "abcd") < 0);
3300 assert(filenameCmp!(CaseSensitive.no)("abcd", "abc") > 0);
3301 assert(filenameCmp!(CaseSensitive.no)("Abc", "abc") == 0);
3302 assert(filenameCmp!(CaseSensitive.no)("abc", "Abc") == 0);
3303 assert(filenameCmp!(CaseSensitive.no)("Abc", "abD") < 0);
3304 assert(filenameCmp!(CaseSensitive.no)("abc", "AbB") > 0);
3306 version (Posix) assert(filenameCmp(`abc\def`, `abc/def`) != 0);
3307 version (Windows) assert(filenameCmp(`abc\def`, `abc/def`) == 0);
3360 assert(balancedParens(pattern, '[', ']', 0));
3361 assert(balancedParens(pattern, '{', '}', 0));
3503 assert(globMatch("foo.bar", "*"));
3504 assert(globMatch("foo.bar", "*.*"));
3505 assert(globMatch(`foo/foo\bar`, "f*b*r"));
3506 assert(globMatch("foo.bar", "f???bar"));
3507 assert(globMatch("foo.bar", "[fg]???bar"));
3508 assert(globMatch("foo.bar", "[!gh]*bar"));
3509 assert(globMatch("bar.fooz", "bar.{foo,bif}z"));
3510 assert(globMatch("bar.bifz", "bar.{foo,bif}z"));
3515 assert(globMatch("foo", "Foo")); in version()
3516 assert(globMatch("Goo.bar", "[fg]???bar")); in version()
3521 assert(!globMatch("foo", "Foo")); in version()
3522 assert(!globMatch("Goo.bar", "[fg]???bar")); in version()
3536 assert(testAliasedString!globMatch("foo.bar", "*"));
3541 assert(globMatch!(CaseSensitive.no)("foo", "Foo"));
3542 assert(!globMatch!(CaseSensitive.yes)("foo", "Foo"));
3544 assert(globMatch("foo", "*"));
3545 assert(globMatch("foo.bar"w, "*"w));
3546 assert(globMatch("foo.bar"d, "*.*"d));
3547 assert(globMatch("foo.bar", "foo*"));
3548 assert(globMatch("foo.bar"w, "f*bar"w));
3549 assert(globMatch("foo.bar"d, "f*b*r"d));
3550 assert(globMatch("foo.bar", "f???bar"));
3551 assert(globMatch("foo.bar"w, "[fg]???bar"w));
3552 assert(globMatch("foo.bar"d, "[!gh]*bar"d));
3554 assert(!globMatch("foo", "bar"));
3555 assert(!globMatch("foo"w, "*.*"w));
3556 assert(!globMatch("foo.bar"d, "f*baz"d));
3557 assert(!globMatch("foo.bar", "f*b*x"));
3558 assert(!globMatch("foo.bar", "[gh]???bar"));
3559 assert(!globMatch("foo.bar"w, "[!fg]*bar"w));
3560 assert(!globMatch("foo.bar"d, "[fg]???baz"d));
3561 assert(!globMatch("foo.di", "*.d")); // test issue 6634: triggered bad assertion
3563 assert(globMatch("foo.bar", "{foo,bif}.bar"));
3564 assert(globMatch("bif.bar"w, "{foo,bif}.bar"w));
3566 assert(globMatch("bar.foo"d, "bar.{foo,bif}"d));
3567 assert(globMatch("bar.bif", "bar.{foo,bif}"));
3569 assert(globMatch("bar.fooz"w, "bar.{foo,bif}z"w));
3570 assert(globMatch("bar.bifz"d, "bar.{foo,bif}z"d));
3572 assert(globMatch("bar.foo", "bar.{biz,,baz}foo"));
3573 assert(globMatch("bar.foo"w, "bar.{biz,}foo"w));
3574 assert(globMatch("bar.foo"d, "bar.{,biz}foo"d));
3575 assert(globMatch("bar.foo", "bar.{}foo"));
3577 assert(globMatch("bar.foo"w, "bar.{ar,,fo}o"w));
3578 assert(globMatch("bar.foo"d, "bar.{,ar,fo}o"d));
3579 assert(globMatch("bar.o", "bar.{,ar,fo}o"));
3581 assert(!globMatch("foo", "foo?"));
3582 assert(!globMatch("foo", "foo[]"));
3583 assert(!globMatch("foo", "foob"));
3584 assert(!globMatch("foo", "foo{b}"));
3587 static assert(globMatch("foo.bar", "[!gh]*bar"));
3658 else static assert(0);
3676 assert(isValidFilename("hello.exe".byCodeUnit));
3687 assert(testAliasedString!isValidFilename("hello.exe"));
3699 else static assert(0);
3706 assert(isValidFilename(to!T(fn)));
3708 assert(!isValidFilename(to!T(fn)));
3713 assert(!isValidFilename(r));
3717 assert(isValidFilename(DirEntry("file.ext")));
3728 assert(!isValidFilename(buf[])); in version()
3779 assert(component.length > 0); in isValidComponent()
3846 else static assert(0);
3854 assert(i > 0);
3867 assert(isValidPath("/foo/bar"));
3868 assert(!isValidPath("/foo\0/bar"));
3869 assert(isValidPath("/"));
3870 assert(isValidPath("a"));
3874 assert(isValidPath(`c:\`));
3875 assert(isValidPath(`c:\foo`));
3876 assert(isValidPath(`c:\foo\.\bar\\\..\`));
3877 assert(!isValidPath(`!:\foo`));
3878 assert(!isValidPath(`c::\foo`));
3879 assert(!isValidPath(`c:\foo?`));
3880 assert(!isValidPath(`c:\foo.`));
3882 assert(isValidPath(`\\server\share`));
3883 assert(isValidPath(`\\server\share\foo`));
3884 assert(isValidPath(`\\server\share\\foo`));
3885 assert(!isValidPath(`\\\server\share\foo`));
3886 assert(!isValidPath(`\\server\\share\foo`));
3887 assert(!isValidPath(`\\ser*er\share\foo`));
3888 assert(!isValidPath(`\\server\sha?e\foo`));
3889 assert(!isValidPath(`\\server\share\|oo`));
3891 assert(isValidPath(`\\?\<>:"?*|/\..\.`));