aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/qml/qmllint/data/badAlias.qml5
-rw-r--r--tests/auto/qml/qmllint/data/badAliasProperty.qml6
-rw-r--r--tests/auto/qml/qmllint/data/goodAlias.qml12
-rw-r--r--tests/auto/qml/qmllint/tst_qmllint.cpp9
4 files changed, 32 insertions, 0 deletions
diff --git a/tests/auto/qml/qmllint/data/badAlias.qml b/tests/auto/qml/qmllint/data/badAlias.qml
new file mode 100644
index 0000000000..2dd7d1a7e0
--- /dev/null
+++ b/tests/auto/qml/qmllint/data/badAlias.qml
@@ -0,0 +1,5 @@
+import QtQml 2.0
+
+QtObject {
+ property alias wrong: nowhere
+}
diff --git a/tests/auto/qml/qmllint/data/badAliasProperty.qml b/tests/auto/qml/qmllint/data/badAliasProperty.qml
new file mode 100644
index 0000000000..9483c52cd0
--- /dev/null
+++ b/tests/auto/qml/qmllint/data/badAliasProperty.qml
@@ -0,0 +1,6 @@
+import QtQml 2.0
+
+QtObject {
+ id: self
+ property alias wrong: self.nowhere
+}
diff --git a/tests/auto/qml/qmllint/data/goodAlias.qml b/tests/auto/qml/qmllint/data/goodAlias.qml
new file mode 100644
index 0000000000..d2fa4485ec
--- /dev/null
+++ b/tests/auto/qml/qmllint/data/goodAlias.qml
@@ -0,0 +1,12 @@
+import QtQuick 2.0
+
+Item {
+ id: self
+
+ QtObject {
+ id: inner
+ }
+
+ property alias innerObj: inner
+ property alias name: self.objectName
+}
diff --git a/tests/auto/qml/qmllint/tst_qmllint.cpp b/tests/auto/qml/qmllint/tst_qmllint.cpp
index d63017e5b1..5066451f6d 100644
--- a/tests/auto/qml/qmllint/tst_qmllint.cpp
+++ b/tests/auto/qml/qmllint/tst_qmllint.cpp
@@ -140,6 +140,14 @@ void TestQmllint::dirtyQmlCode_data()
<< QStringLiteral("unknownJavascriptMethod.qml")
<< QString("Warning: Property \"foo2\" not found on type \"Methods\" at 5:25")
<< QString();
+ QTest::newRow("badAlias")
+ << QStringLiteral("badAlias.qml")
+ << QString("Warning: unqualified access at 4:27")
+ << QString();
+ QTest::newRow("badAliasProperty")
+ << QStringLiteral("badAliasProperty.qml")
+ << QString("Warning: Property \"nowhere\" not found on type \"QtObject\" at 5:32")
+ << QString();
}
void TestQmllint::dirtyQmlCode()
@@ -168,6 +176,7 @@ void TestQmllint::cleanQmlCode_data()
QTest::newRow("forLoop") << QStringLiteral("forLoop.qml");
QTest::newRow("esmodule") << QStringLiteral("esmodule.mjs");
QTest::newRow("methodsInJavascript") << QStringLiteral("javascriptMethods.qml");
+ QTest::newRow("goodAlias") << QStringLiteral("goodAlias.qml");
}
void TestQmllint::cleanQmlCode()