MCPcopy Create free account
hub / github.com/ElyPrismLauncher/Launcher / test_path_depth

Method test_path_depth

tests/FileSystem_test.cpp:683–696  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

681 }
682
683 void test_path_depth()
684 {
685 QCOMPARE(FS::pathDepth(""), 0);
686 QCOMPARE(FS::pathDepth("."), 0);
687 QCOMPARE(FS::pathDepth("foo.txt"), 0);
688 QCOMPARE(FS::pathDepth("./foo.txt"), 0);
689 QCOMPARE(FS::pathDepth("./bar/foo.txt"), 1);
690 QCOMPARE(FS::pathDepth("../bar/foo.txt"), 0);
691 QCOMPARE(FS::pathDepth("/bar/foo.txt"), 1);
692 QCOMPARE(FS::pathDepth("baz/bar/foo.txt"), 2);
693 QCOMPARE(FS::pathDepth("/baz/bar/foo.txt"), 2);
694 QCOMPARE(FS::pathDepth("./baz/bar/foo.txt"), 2);
695 QCOMPARE(FS::pathDepth("/baz/../bar/foo.txt"), 1);
696 }
697
698 void test_path_trunc()
699 {

Callers

nothing calls this directly

Calls 1

pathDepthFunction · 0.85

Tested by

no test coverage detected