MCPcopy Create free account
hub / github.com/PolyMC/PolyMC / test_copy_with_dot_hidden

Method test_copy_with_dot_hidden

tests/FileSystem_test.cpp:150–184  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

148 }
149
150 void test_copy_with_dot_hidden()
151 {
152 QString folder = QFINDTESTDATA("testdata/FileSystem/test_folder");
153 auto f = [&folder]()
154 {
155 QTemporaryDir tempDir;
156 tempDir.setAutoRemove(true);
157 qDebug() << "From:" << folder << "To:" << tempDir.path();
158
159 QDir target_dir(FS::PathCombine(tempDir.path(), "test_folder"));
160 qDebug() << tempDir.path();
161 qDebug() << target_dir.path();
162 FS::copy c(folder, target_dir.path());
163 c();
164
165 auto filter = QDir::Filter::Files | QDir::Filter::Dirs | QDir::Filter::Hidden;
166
167 for (auto entry: target_dir.entryList(filter)) {
168 qDebug() << entry;
169 }
170
171 QVERIFY(target_dir.entryList(filter).contains(".secret_folder"));
172 target_dir.cd(".secret_folder");
173 QVERIFY(target_dir.entryList(filter).contains(".secret_file.txt"));
174 };
175
176 // first try variant without trailing /
177 QVERIFY(!folder.endsWith('/'));
178 f();
179
180 // then variant with trailing /
181 folder.append('/');
182 QVERIFY(folder.endsWith('/'));
183 f();
184 }
185
186 void test_getDesktop()
187 {

Callers

nothing calls this directly

Calls 4

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

Tested by

no test coverage detected