| 81 | } |
| 82 | |
| 83 | void test_copy() |
| 84 | { |
| 85 | QString folder = QFINDTESTDATA("testdata/FileSystem/test_folder"); |
| 86 | auto f = [&folder]() |
| 87 | { |
| 88 | QTemporaryDir tempDir; |
| 89 | tempDir.setAutoRemove(true); |
| 90 | qDebug() << "From:" << folder << "To:" << tempDir.path(); |
| 91 | |
| 92 | QDir target_dir(FS::PathCombine(tempDir.path(), "test_folder")); |
| 93 | qDebug() << tempDir.path(); |
| 94 | qDebug() << target_dir.path(); |
| 95 | FS::copy c(folder, target_dir.path()); |
| 96 | c(); |
| 97 | |
| 98 | for(auto entry: target_dir.entryList()) |
| 99 | { |
| 100 | qDebug() << entry; |
| 101 | } |
| 102 | QVERIFY(target_dir.entryList().contains("pack.mcmeta")); |
| 103 | QVERIFY(target_dir.entryList().contains("assets")); |
| 104 | }; |
| 105 | |
| 106 | // first try variant without trailing / |
| 107 | QVERIFY(!folder.endsWith('/')); |
| 108 | f(); |
| 109 | |
| 110 | // then variant with trailing / |
| 111 | folder.append('/'); |
| 112 | QVERIFY(folder.endsWith('/')); |
| 113 | f(); |
| 114 | } |
| 115 | |
| 116 | void test_copy_with_blacklist() |
| 117 | { |
nothing calls this directly
no test coverage detected