aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@digia.com>2013-08-08 14:17:53 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-08-08 15:35:20 +0200
commitcdaa8282a7ebf780b1d02825062f19a80e827af5 (patch)
tree070697e407666b52a9652142194b911d97e6f97a /tests
parent0c179baade8f4a57c0f9fe7b48367412e8a41f2a (diff)
Fix another bug with automatic semicolon insertion
Avoid empty statements after else. Change-Id: Ia7782a3371bc79c7e93857aa252309d2824a5a9e Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/qml/qjsengine/tst_qjsengine.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/tests/auto/qml/qjsengine/tst_qjsengine.cpp b/tests/auto/qml/qjsengine/tst_qjsengine.cpp
index 1f43d21c51..b69f57b339 100644
--- a/tests/auto/qml/qjsengine/tst_qjsengine.cpp
+++ b/tests/auto/qml/qjsengine/tst_qjsengine.cpp
@@ -1578,6 +1578,11 @@ void tst_QJSEngine::automaticSemicolonInsertion()
QVERIFY(ret.isError());
}
{
+ QJSValue ret = eng.evaluate("n = 0; if (1) --n;else\n ++n;\n n");
+ QVERIFY(ret.isNumber());
+ QCOMPARE(ret.toInt(), -1);
+ }
+ {
QJSValue ret = eng.evaluate("while (0)");
QVERIFY(ret.isError());
}