aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml/qmlcppcodegen
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/qml/qmlcppcodegen')
-rw-r--r--tests/auto/qml/qmlcppcodegen/data/jsArrayMethodsUntyped.qml7
-rw-r--r--tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp2
2 files changed, 9 insertions, 0 deletions
diff --git a/tests/auto/qml/qmlcppcodegen/data/jsArrayMethodsUntyped.qml b/tests/auto/qml/qmlcppcodegen/data/jsArrayMethodsUntyped.qml
index 7426c692fe..ec61adce19 100644
--- a/tests/auto/qml/qmlcppcodegen/data/jsArrayMethodsUntyped.qml
+++ b/tests/auto/qml/qmlcppcodegen/data/jsArrayMethodsUntyped.qml
@@ -14,4 +14,11 @@ QtObject {
property string jsArrayJoin: jsArray().join()
property int jsArrayIndexOf: jsArray().indexOf(l2)
property int jsArrayLastIndexOf: jsArray().lastIndexOf(l3)
+
+ property string pushAndJoin: {
+ var s = [];
+ s.push("A")
+ s.push("B")
+ return s.join("+");
+ }
}
diff --git a/tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp b/tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp
index 21d649a690..22479d3d9c 100644
--- a/tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp
+++ b/tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp
@@ -2752,6 +2752,8 @@ void tst_QmlCppCodegen::jsArrayMethods()
QCOMPARE(object->property("listPropertyLastIndexOf"), object->property("jsArrayLastIndexOf"));
QCOMPARE(object->property("listPropertyLastIndexOf").toInt(), 5);
+
+ QCOMPARE(check->property("pushAndJoin").toString(), QStringLiteral("A+B"));
}
void tst_QmlCppCodegen::jsArrayMethodsWithParams()