MCPcopy Create free account
hub / github.com/QuasarApp/CQtDeployer / test

Method test

tests/units/linux/distrostructtest.cpp:17–62  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

15
16
17void DistroStructTest::test() {
18 DistroStruct distro;
19
20 auto cases = QList<QPair<QString,QString>>{
21 {"", "/"},
22 {"/", "/"},
23 {"/res","/../"},
24 {"/res/","/../"},
25 {"/res/type","/../../"},
26 {"/res/type/","/../../"},
27 {"res/type","../../"},
28 {"res/type/","../../"},
29 {"res//type/","../../"},
30 {"res////type/","../../"},
31 {"//res///type/////","/../../"},
32 {"\\", "/"},
33 {"\\res","/../"},
34 {"\\res\\","/../"},
35 {"\\res\\type","/../../"},
36 {"\\res\\type\\","/../../"},
37 {"res\\type","../../"},
38 {"res\\type\\","../../"},
39 {"res\\\\type\\","../../"},
40 {"res\\\\\\\\type\\","../../"},
41 {"\\\\res\\\\\\type\\\\\\\\\\","/../../"},
42 };
43
44 for (const auto &i: std::as_const(cases)) {
45 if (distro.getRelativePath(i.first) != i.second)
46 QVERIFY(false);
47 }
48
49 distro = DistroStruct();
50
51 distro.setTrOutDir("/tr/");
52 QVERIFY(distro.getTrOutDir() == "/tr/");
53
54
55 distro.setTrOutDir("/tr");
56 QVERIFY(distro.getTrOutDir() == "/tr/");
57
58 distro.setTrOutDir("tr");
59 QVERIFY(distro.getTrOutDir() == "/tr/");
60
61
62}

Callers

nothing calls this directly

Calls 3

getRelativePathMethod · 0.80
setTrOutDirMethod · 0.80
getTrOutDirMethod · 0.80

Tested by

no test coverage detected