| 15 | |
| 16 | |
| 17 | void 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 | } |
nothing calls this directly
no test coverage detected