aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2021-11-24 13:14:17 +0100
committerUlf Hermann <ulf.hermann@qt.io>2021-11-24 19:44:50 +0100
commit52ca4efeb94a72b0eb2161167dcb2d139ec57a08 (patch)
treef97afcda1384d57fe3f80b2450a5fbd02db6923d /tests/auto/qml
parent650e6739c403b4c5dbf5ebdd8883a0366b6260fa (diff)
qmllint: Warn about lower case enum names/values
Those are invalid in QML, even if we know them ahead of time. Fixes: QTBUG-98541 Change-Id: I677f4d8be29ea4ab7040faf9c54ae45cdad75cad Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'tests/auto/qml')
-rw-r--r--tests/auto/qml/qmllint/data/enumInvalid.qml6
-rw-r--r--tests/auto/qml/qmllint/tst_qmllint.cpp4
2 files changed, 10 insertions, 0 deletions
diff --git a/tests/auto/qml/qmllint/data/enumInvalid.qml b/tests/auto/qml/qmllint/data/enumInvalid.qml
new file mode 100644
index 0000000000..a14955d3e2
--- /dev/null
+++ b/tests/auto/qml/qmllint/data/enumInvalid.qml
@@ -0,0 +1,6 @@
+import QtQml
+
+QtObject {
+ property bool c: Qt.red > 4
+ property bool d: Qt.red < 2
+}
diff --git a/tests/auto/qml/qmllint/tst_qmllint.cpp b/tests/auto/qml/qmllint/tst_qmllint.cpp
index 511d25acc3..2f06c43c8d 100644
--- a/tests/auto/qml/qmllint/tst_qmllint.cpp
+++ b/tests/auto/qml/qmllint/tst_qmllint.cpp
@@ -751,6 +751,10 @@ void TestQmllint::dirtyQmlCode_data()
<< QStringLiteral("missingQmltypes.qml")
<< QStringLiteral("QML types file does not exist")
<< QString() << false;
+ QTest::newRow("enumInvalid")
+ << QStringLiteral("enumInvalid.qml")
+ << QStringLiteral("Property \"red\" not found on type \"QtObject\"")
+ << QString() << false;
}
void TestQmllint::dirtyQmlCode()