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

Method test_copy

launcher/FileSystem_test.cpp:82–113  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

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