aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2021-04-07 10:13:03 +0200
committerUlf Hermann <ulf.hermann@qt.io>2021-04-09 09:26:25 +0200
commit0a07a6261263bb915c20539812146afd9005b64b (patch)
treea96d7940377176d8240dfb5b3842a3432c2e35e0 /tests/auto/qml
parentd62b56c4217a2610d9c7db84ffd3cde010ffae7c (diff)
Fix string type name in qmllint
The "length" property is special cased because it's the only own property of any JavaScript built-in type. As we've changed the internal name of the string type in builtins.qmltypes, we need to reflect this in qmllint. Fixes: QTBUG-92447 Change-Id: I9a5c7e9ab3da686bb6ac3fdffa36269abb0eb6ea Reviewed-by: Maximilian Goldstein <max.goldstein@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit b28c8c87ec84dccc156603f8479fd0a8a06bc46c)
Diffstat (limited to 'tests/auto/qml')
-rw-r--r--tests/auto/qml/qmllint/data/stringLength.qml9
-rw-r--r--tests/auto/qml/qmllint/tst_qmllint.cpp1
2 files changed, 10 insertions, 0 deletions
diff --git a/tests/auto/qml/qmllint/data/stringLength.qml b/tests/auto/qml/qmllint/data/stringLength.qml
new file mode 100644
index 0000000000..354fed7b22
--- /dev/null
+++ b/tests/auto/qml/qmllint/data/stringLength.qml
@@ -0,0 +1,9 @@
+import QtQuick 2.15
+
+TextInput {
+ id: textInput
+
+ Component.onCompleted: {
+ console.log("text.length", textInput.text.length);
+ }
+}
diff --git a/tests/auto/qml/qmllint/tst_qmllint.cpp b/tests/auto/qml/qmllint/tst_qmllint.cpp
index 9dd5679769..1a102fe81f 100644
--- a/tests/auto/qml/qmllint/tst_qmllint.cpp
+++ b/tests/auto/qml/qmllint/tst_qmllint.cpp
@@ -314,6 +314,7 @@ void TestQmllint::cleanQmlCode_data()
QTest::newRow("optionalImport") << QStringLiteral("optionalImport.qml");
QTest::newRow("goodAliasObject") << QStringLiteral("goodAliasObject.qml");
QTest::newRow("segFault") << QStringLiteral("SegFault.qml");
+ QTest::newRow("stringLength") << QStringLiteral("stringLength.qml");
}
void TestQmllint::cleanQmlCode()