aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml/qmlformat/data/forOf.qml
diff options
context:
space:
mode:
authorMaximilian Goldstein <max.goldstein@qt.io>2020-10-01 09:41:16 +0200
committerMaximilian Goldstein <max.goldstein@qt.io>2020-10-06 09:02:50 +0200
commit9cfda79202c9c7955a1100861ed2135506302921 (patch)
tree40320d5ec59d15e8d7ff44f69709c26b11514141 /tests/auto/qml/qmlformat/data/forOf.qml
parent2b8ec2eacbf96340ce95a2648450fde07bf3b5c3 (diff)
qmlformat: Fix formatting of for...of loops using array variables
Fixes: QTBUG-86980 Pick-to: 5.15 Change-Id: Id27350821051709894c7645a362cfdf7ce0d279c Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Diffstat (limited to 'tests/auto/qml/qmlformat/data/forOf.qml')
-rw-r--r--tests/auto/qml/qmlformat/data/forOf.qml12
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/auto/qml/qmlformat/data/forOf.qml b/tests/auto/qml/qmlformat/data/forOf.qml
new file mode 100644
index 0000000000..0c3be0d2a2
--- /dev/null
+++ b/tests/auto/qml/qmlformat/data/forOf.qml
@@ -0,0 +1,12 @@
+import QtQml 2.0
+
+QtObject {
+ Component.onCompleted: {
+ var list = [[1,2],[3,4],[5,6]];
+
+ for (const [x,y] of list)
+ console.log("X: "+x+"; Y: "+y);
+ for (let [x,y] of list)
+ console.log("X: "+x+"; Y: "+y);
+ }
+}