MCPcopy Create free account
hub / github.com/FreesmTeam/FreesmLauncher / test_path_depth

Method test_path_depth

tests/FileSystem_test.cpp:732–745  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

730 }
731
732 void test_path_depth()
733 {
734 QCOMPARE(FS::pathDepth(""), 0);
735 QCOMPARE(FS::pathDepth("."), 0);
736 QCOMPARE(FS::pathDepth("foo.txt"), 0);
737 QCOMPARE(FS::pathDepth("./foo.txt"), 0);
738 QCOMPARE(FS::pathDepth("./bar/foo.txt"), 1);
739 QCOMPARE(FS::pathDepth("../bar/foo.txt"), 0);
740 QCOMPARE(FS::pathDepth("/bar/foo.txt"), 1);
741 QCOMPARE(FS::pathDepth("baz/bar/foo.txt"), 2);
742 QCOMPARE(FS::pathDepth("/baz/bar/foo.txt"), 2);
743 QCOMPARE(FS::pathDepth("./baz/bar/foo.txt"), 2);
744 QCOMPARE(FS::pathDepth("/baz/../bar/foo.txt"), 1);
745 }
746
747 void test_path_trunc()
748 {

Callers

nothing calls this directly

Calls 1

pathDepthFunction · 0.85

Tested by

no test coverage detected