MCPcopy Create free account
hub / github.com/KDE/kdevelop / QUrl_acceptance

Method QUrl_acceptance

kdevplatform/util/tests/test_path.cpp:692–709  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

690}
691
692void TestPath::QUrl_acceptance()
693{
694 const QUrl baseLocal = QUrl(QStringLiteral("file:///foo.h"));
695 QCOMPARE(baseLocal.isValid(), true);
696 QCOMPARE(baseLocal.isRelative(), false);
697 QCOMPARE(baseLocal, QUrl::fromLocalFile(QStringLiteral("/foo.h")));
698 QCOMPARE(baseLocal, QUrl::fromUserInput(QStringLiteral("/foo.h")));
699
700 QUrl relative(QStringLiteral("bar.h"));
701 QCOMPARE(relative.isRelative(), true);
702 QCOMPARE(baseLocal.resolved(relative), QUrl(QStringLiteral("file:///bar.h")));
703 QUrl relative2(QStringLiteral("/foo/bar.h"));
704 QCOMPARE(relative2.isRelative(), true);
705 QCOMPARE(baseLocal.resolved(relative2), QUrl(QStringLiteral("file:///foo/bar.h")));
706
707 const QUrl baseRemote = QUrl(QStringLiteral("http://foo.org/asdf/foo/asdf"));
708 QCOMPARE(baseRemote.resolved(relative), QUrl(QStringLiteral("http://foo.org/asdf/foo/bar.h")));
709}
710
711#include "moc_test_path.cpp"

Callers

nothing calls this directly

Calls 3

resolvedMethod · 0.80
QUrlClass · 0.50
isValidMethod · 0.45

Tested by

no test coverage detected