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

Method test_copy

tests/FileSystem_test.cpp:83–114  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

81 }
82
83 void test_copy()
84 {
85 QString folder = QFINDTESTDATA("testdata/FileSystem/test_folder");
86 auto f = [&folder]()
87 {
88 QTemporaryDir tempDir;
89 tempDir.setAutoRemove(true);
90 qDebug() << "From:" << folder << "To:" << tempDir.path();
91
92 QDir target_dir(FS::PathCombine(tempDir.path(), "test_folder"));
93 qDebug() << tempDir.path();
94 qDebug() << target_dir.path();
95 FS::copy c(folder, target_dir.path());
96 c();
97
98 for(auto entry: target_dir.entryList())
99 {
100 qDebug() << entry;
101 }
102 QVERIFY(target_dir.entryList().contains("pack.mcmeta"));
103 QVERIFY(target_dir.entryList().contains("assets"));
104 };
105
106 // first try variant without trailing /
107 QVERIFY(!folder.endsWith('/'));
108 f();
109
110 // then variant with trailing /
111 folder.append('/');
112 QVERIFY(folder.endsWith('/'));
113 f();
114 }
115
116 void test_copy_with_blacklist()
117 {

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