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

Method test_path_trunc

tests/FileSystem_test.cpp:747–760  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

745 }
746
747 void test_path_trunc()
748 {
749 QCOMPARE(FS::pathTruncate("", 0), QDir::toNativeSeparators(""));
750 QCOMPARE(FS::pathTruncate("foo.txt", 0), QDir::toNativeSeparators(""));
751 QCOMPARE(FS::pathTruncate("foo.txt", 1), QDir::toNativeSeparators(""));
752 QCOMPARE(FS::pathTruncate("./bar/foo.txt", 0), QDir::toNativeSeparators("./bar"));
753 QCOMPARE(FS::pathTruncate("./bar/foo.txt", 1), QDir::toNativeSeparators("./bar"));
754 QCOMPARE(FS::pathTruncate("/bar/foo.txt", 1), QDir::toNativeSeparators("/bar"));
755 QCOMPARE(FS::pathTruncate("bar/foo.txt", 1), QDir::toNativeSeparators("bar"));
756 QCOMPARE(FS::pathTruncate("baz/bar/foo.txt", 2), QDir::toNativeSeparators("baz/bar"));
757#if defined(Q_OS_WIN)
758 QCOMPARE(FS::pathTruncate("C:\\bar\\foo.txt", 1), QDir::toNativeSeparators("C:\\bar"));
759#endif
760 }
761};
762
763QTEST_GUILESS_MAIN(FileSystemTest)

Callers

nothing calls this directly

Calls 1

pathTruncateFunction · 0.85

Tested by

no test coverage detected