Files
allhaileris afb81b8278
Some checks failed
Docker. / Ubuntu (push) Has been cancelled
User-agent updater. / User-agent (push) Failing after 15s
Lock Threads / lock (push) Failing after 10s
Waiting for answer. / waiting-for-answer (push) Failing after 22s
Close stale issues and PRs / stale (push) Successful in 13s
Needs user action. / needs-user-action (push) Failing after 8s
Can't reproduce. / cant-reproduce (push) Failing after 8s
init
2026-02-16 15:50:16 +03:00

44 lines
1.8 KiB
C++

/*
SPDX-FileCopyrightText: 2014-2019 Harald Sitter <sitter@kde.org>
SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
*/
#include <QTest>
#include "kosrelease.h"
class KOSReleaseTest : public QObject
{
Q_OBJECT
private Q_SLOTS:
void testParse()
{
KOSRelease r(QFINDTESTDATA("data/os-release"));
QCOMPARE(r.name(), QStringLiteral("Name"));
QCOMPARE(r.version(), QStringLiteral("100.5"));
QCOMPARE(r.id(), QStringLiteral("theid"));
QCOMPARE(r.idLike(), QStringList({QStringLiteral("otherid"), QStringLiteral("otherotherid")}));
QCOMPARE(r.versionCodename(), QStringLiteral("versioncodename"));
QCOMPARE(r.versionId(), QStringLiteral("500.1"));
QCOMPARE(r.prettyName(), QStringLiteral("Pretty Name #1"));
QCOMPARE(r.ansiColor(), QStringLiteral("1;34"));
QCOMPARE(r.cpeName(), QStringLiteral("cpe:/o:foo:bar:100"));
QCOMPARE(r.homeUrl(), QStringLiteral("https://url.home"));
QCOMPARE(r.documentationUrl(), QStringLiteral("https://url.docs"));
QCOMPARE(r.supportUrl(), QStringLiteral("https://url.support"));
QCOMPARE(r.bugReportUrl(), QStringLiteral("https://url.bugs"));
QCOMPARE(r.privacyPolicyUrl(), QStringLiteral("https://url.privacy"));
QCOMPARE(r.buildId(), QStringLiteral("105.5"));
QCOMPARE(r.variant(), QStringLiteral("Test = Edition"));
QCOMPARE(r.variantId(), QStringLiteral("test"));
QCOMPARE(r.logo(), QStringLiteral("start-here-test"));
QCOMPARE(r.extraKeys(), QStringList({QStringLiteral("DEBIAN_BTS")}));
QCOMPARE(r.extraValue(QStringLiteral("DEBIAN_BTS")), QStringLiteral("debbugs://bugs.debian.org/"));
}
};
QTEST_MAIN(KOSReleaseTest)
#include "kosreleasetest.moc"