| 146 | } |
| 147 | |
| 148 | void test_copy() |
| 149 | { |
| 150 | QString folder = QFINDTESTDATA("testdata/FileSystem/test_folder"); |
| 151 | auto f = [&folder]() { |
| 152 | QTemporaryDir tempDir; |
| 153 | tempDir.setAutoRemove(true); |
| 154 | qDebug() << "From:" << folder << "To:" << tempDir.path(); |
| 155 | |
| 156 | QDir target_dir(FS::PathCombine(tempDir.path(), "test_folder")); |
| 157 | qDebug() << tempDir.path(); |
| 158 | qDebug() << target_dir.path(); |
| 159 | FS::copy c(folder, target_dir.path()); |
| 160 | c(); |
| 161 | |
| 162 | for (auto entry : target_dir.entryList()) { |
| 163 | qDebug() << entry; |
| 164 | } |
| 165 | QVERIFY(target_dir.entryList().contains("pack.mcmeta")); |
| 166 | QVERIFY(target_dir.entryList().contains("assets")); |
| 167 | }; |
| 168 | |
| 169 | // first try variant without trailing / |
| 170 | QVERIFY(!folder.endsWith('/')); |
| 171 | f(); |
| 172 | |
| 173 | // then variant with trailing / |
| 174 | folder.append('/'); |
| 175 | QVERIFY(folder.endsWith('/')); |
| 176 | f(); |
| 177 | } |
| 178 | |
| 179 | void test_copy_with_blacklist() |
| 180 | { |
nothing calls this directly
no test coverage detected