| 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 | |
| 714 | QTEST_GUILESS_MAIN(FileSystemTest) |
nothing calls this directly
no test coverage detected