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

Method test_copy

tests/FileSystem_test.cpp:148–177  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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 {

Callers

nothing calls this directly

Calls 4

PathCombineFunction · 0.85
appendMethod · 0.80
pathMethod · 0.45
containsMethod · 0.45

Tested by

no test coverage detected