aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml/qjsengine/tst_qjsengine.cpp
diff options
context:
space:
mode:
authorErik Verbruggen <erik.verbruggen@qt.io>2019-03-18 11:49:05 +0100
committerErik Verbruggen <erik.verbruggen@qt.io>2019-03-21 08:52:54 +0000
commitc091f3f4b4889ac6be26e018c5e8b673adee7c47 (patch)
tree9b7090f13245248955deff6cb35243c814576c32 /tests/auto/qml/qjsengine/tst_qjsengine.cpp
parent3af36ba6eb58b2f455e015579540baa51e0c5c26 (diff)
V4: Do not invert non-reflexive comparison binops
This is only useful for the few (4) comparisons where we have specialized instructions, and it's very error-prone. Change-Id: I37efe94f54ba0adf393d9236df2d13aa6685eb46 Fixes: QTBUG-74476 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'tests/auto/qml/qjsengine/tst_qjsengine.cpp')
-rw-r--r--tests/auto/qml/qjsengine/tst_qjsengine.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/auto/qml/qjsengine/tst_qjsengine.cpp b/tests/auto/qml/qjsengine/tst_qjsengine.cpp
index 42d8f37ca8..0491ccd473 100644
--- a/tests/auto/qml/qjsengine/tst_qjsengine.cpp
+++ b/tests/auto/qml/qjsengine/tst_qjsengine.cpp
@@ -235,6 +235,8 @@ private slots:
void importModuleWithLexicallyScopedVars();
void importExportErrors();
+ void equality();
+
public:
Q_INVOKABLE QJSValue throwingCppMethod1();
Q_INVOKABLE void throwingCppMethod2();
@@ -4622,6 +4624,14 @@ void tst_QJSEngine::importExportErrors()
}
}
+void tst_QJSEngine::equality()
+{
+ QJSEngine engine;
+ QJSValue ok = engine.evaluate("(0 < 0) ? 'ko' : 'ok'");
+ QVERIFY(ok.isString());
+ QCOMPARE(ok.toString(), QString("ok"));
+}
+
QTEST_MAIN(tst_QJSEngine)
#include "tst_qjsengine.moc"