// Copyright (C) 2021 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #include #include #include #include #include class tst_empty_qmldir : public QObject { Q_OBJECT private slots: void canSelfImport(); }; void tst_empty_qmldir::canSelfImport() { QQmlEngine engine; QQmlComponent component(&engine, QUrl("qrc:/flee.qml")); QScopedPointer obj(component.create()); QVERIFY2(!obj.isNull(), qPrintable(component.errorString())); QCOMPARE(obj->property("success").toInt(), -11); QObject *enemy = qvariant_cast(obj->property("other")); QVERIFY(enemy != nullptr); QCOMPARE(enemy->property("name").toString(), QStringLiteral("evil")); } QTEST_MAIN(tst_empty_qmldir) #include "main.moc"