aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml/qjsengine
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@qt.io>2016-05-13 00:28:14 +0200
committerLiang Qi <liang.qi@qt.io>2016-05-13 08:28:27 +0200
commitae745746a666134d9e9258b8c2ff00540624d835 (patch)
tree8294fffa3d752d61f79004fb04e21e927472fd8f /tests/auto/qml/qjsengine
parenta7b383ab989e74ef552c2ef9c38377e065f1ab0e (diff)
parent531d00c1909527cb1bc28f17197267ccde408b0c (diff)
Merge remote-tracking branch 'origin/5.7' into dev
Conflicts: src/qml/jsapi/qjsengine.cpp src/qml/qml/qqmlengine_p.h src/quick/items/qquickanchors.cpp src/quick/items/qquickanimatedimage_p_p.h src/quick/items/qquickitem_p.h tests/auto/qml/qqmlecmascript/testtypes.h tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp tests/benchmarks/qml/creation/tst_creation.cpp Change-Id: I65861e32f16e8a04c7090a90231627e1ebf6ba6f
Diffstat (limited to 'tests/auto/qml/qjsengine')
-rw-r--r--tests/auto/qml/qjsengine/tst_qjsengine.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/auto/qml/qjsengine/tst_qjsengine.cpp b/tests/auto/qml/qjsengine/tst_qjsengine.cpp
index adf944c7e1..99c18f91a1 100644
--- a/tests/auto/qml/qjsengine/tst_qjsengine.cpp
+++ b/tests/auto/qml/qjsengine/tst_qjsengine.cpp
@@ -137,6 +137,7 @@ private slots:
void functionDeclarationsInConditionals();
void arrayPop_QTBUG_35979();
+ void array_unshift_QTBUG_52065();
void regexpLastMatch();
void indexedAccesses();
@@ -3045,6 +3046,20 @@ void tst_QJSEngine::arrayPop_QTBUG_35979()
QCOMPARE(result.toString(), QString("1,3"));
}
+void tst_QJSEngine::array_unshift_QTBUG_52065()
+{
+ QJSEngine eng;
+ QJSValue result = eng.evaluate("[1, 2, 3, 4, 5, 6, 7, 8, 9]");
+ QJSValue unshift = result.property(QStringLiteral("unshift"));
+ unshift.callWithInstance(result, QJSValueList() << QJSValue(0));
+
+ int len = result.property(QStringLiteral("length")).toInt();
+ QCOMPARE(len, 10);
+
+ for (int i = 0; i < len; ++i)
+ QCOMPARE(result.property(i).toInt(), i);
+}
+
void tst_QJSEngine::regexpLastMatch()
{
QJSEngine eng;