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

Method test_path_trunc

tests/FileSystem_test.cpp:698–711  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

696 }
697
698 void test_path_trunc()
699 {
700 QCOMPARE(FS::pathTruncate("", 0), QDir::toNativeSeparators(""));
701 QCOMPARE(FS::pathTruncate("foo.txt", 0), QDir::toNativeSeparators(""));
702 QCOMPARE(FS::pathTruncate("foo.txt", 1), QDir::toNativeSeparators(""));
703 QCOMPARE(FS::pathTruncate("./bar/foo.txt", 0), QDir::toNativeSeparators("./bar"));
704 QCOMPARE(FS::pathTruncate("./bar/foo.txt", 1), QDir::toNativeSeparators("./bar"));
705 QCOMPARE(FS::pathTruncate("/bar/foo.txt", 1), QDir::toNativeSeparators("/bar"));
706 QCOMPARE(FS::pathTruncate("bar/foo.txt", 1), QDir::toNativeSeparators("bar"));
707 QCOMPARE(FS::pathTruncate("baz/bar/foo.txt", 2), QDir::toNativeSeparators("baz/bar"));
708#if defined(Q_OS_WIN)
709 QCOMPARE(FS::pathTruncate("C:\\bar\\foo.txt", 1), QDir::toNativeSeparators("C:\\bar"));
710#endif
711 }
712};
713
714QTEST_GUILESS_MAIN(FileSystemTest)

Callers

nothing calls this directly

Calls 1

pathTruncateFunction · 0.85

Tested by

no test coverage detected