diff options
Diffstat (limited to 'tests/auto/qml/qmlformat/data')
-rw-r--r-- | tests/auto/qml/qmlformat/data/forOf.formatted.qml | 9 | ||||
-rw-r--r-- | tests/auto/qml/qmlformat/data/forOf.qml | 12 |
2 files changed, 21 insertions, 0 deletions
diff --git a/tests/auto/qml/qmlformat/data/forOf.formatted.qml b/tests/auto/qml/qmlformat/data/forOf.formatted.qml new file mode 100644 index 0000000000..fa29f16b81 --- /dev/null +++ b/tests/auto/qml/qmlformat/data/forOf.formatted.qml @@ -0,0 +1,9 @@ +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) + } +} 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); + } +} |