CQtDeployer/tests/units/linux/distrostructtest.cpp
EndrII 73ba178463
All checks were successful
buildbot/IOSCMakeBuilder Build finished.
buildbot/WindowsCMakeBuilder Build finished.
ref #780 ExtraPluginTest fixed
2023-11-04 23:58:04 +01:00

63 lines
1.6 KiB
C++

//#
//# Copyright (C) 2020-2023 QuasarApp.
//# Distributed under the GPLv3 software license, see the accompanying
//# Everyone is permitted to copy and distribute verbatim copies
//# of this license document, but changing it is not allowed.
//#
#include "distrostructtest.h"
#include <configparser.h>
#include <dependenciesscanner.h>
#include <filemanager.h>
#include <packing.h>
#include <pluginsparser.h>
void DistroStructTest::test() {
DistroStruct distro;
auto cases = QList<QPair<QString,QString>>{
{"", "/"},
{"/", "/"},
{"/res","/../"},
{"/res/","/../"},
{"/res/type","/../../"},
{"/res/type/","/../../"},
{"res/type","../../"},
{"res/type/","../../"},
{"res//type/","../../"},
{"res////type/","../../"},
{"//res///type/////","/../../"},
{"\\", "/"},
{"\\res","/../"},
{"\\res\\","/../"},
{"\\res\\type","/../../"},
{"\\res\\type\\","/../../"},
{"res\\type","../../"},
{"res\\type\\","../../"},
{"res\\\\type\\","../../"},
{"res\\\\\\\\type\\","../../"},
{"\\\\res\\\\\\type\\\\\\\\\\","/../../"},
};
for (const auto &i: std::as_const(cases)) {
if (distro.getRelativePath(i.first) != i.second)
QVERIFY(false);
}
distro = DistroStruct();
distro.setTrOutDir("/tr/");
QVERIFY(distro.getTrOutDir() == "/tr/");
distro.setTrOutDir("/tr");
QVERIFY(distro.getTrOutDir() == "/tr/");
distro.setTrOutDir("tr");
QVERIFY(distro.getTrOutDir() == "/tr/");
}