| 114 | } |
| 115 | |
| 116 | void test_copy_with_blacklist() |
| 117 | { |
| 118 | QString folder = QFINDTESTDATA("testdata/FileSystem/test_folder"); |
| 119 | auto f = [&folder]() |
| 120 | { |
| 121 | QTemporaryDir tempDir; |
| 122 | tempDir.setAutoRemove(true); |
| 123 | qDebug() << "From:" << folder << "To:" << tempDir.path(); |
| 124 | |
| 125 | QDir target_dir(FS::PathCombine(tempDir.path(), "test_folder")); |
| 126 | qDebug() << tempDir.path(); |
| 127 | qDebug() << target_dir.path(); |
| 128 | FS::copy c(folder, target_dir.path()); |
| 129 | c.blacklist(new RegexpMatcher("[.]?mcmeta")); |
| 130 | c(); |
| 131 | |
| 132 | for(auto entry: target_dir.entryList()) |
| 133 | { |
| 134 | qDebug() << entry; |
| 135 | } |
| 136 | QVERIFY(!target_dir.entryList().contains("pack.mcmeta")); |
| 137 | QVERIFY(target_dir.entryList().contains("assets")); |
| 138 | }; |
| 139 | |
| 140 | // first try variant without trailing / |
| 141 | QVERIFY(!folder.endsWith('/')); |
| 142 | f(); |
| 143 | |
| 144 | // then variant with trailing / |
| 145 | folder.append('/'); |
| 146 | QVERIFY(folder.endsWith('/')); |
| 147 | f(); |
| 148 | } |
| 149 | |
| 150 | void test_copy_with_dot_hidden() |
| 151 | { |
nothing calls this directly
no test coverage detected