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

Method test_copy_with_blacklist

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

Source from the content-addressed store, hash-verified

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 {

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