aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml/qmltc
diff options
context:
space:
mode:
authorAndrei Golubev <andrei.golubev@qt.io>2022-07-26 16:29:02 +0200
committerAndrei Golubev <andrei.golubev@qt.io>2022-07-27 11:54:48 +0200
commit2d5f3eb86e1eed13f143173eec0cbc724ed5d9a9 (patch)
tree42ad52358f29b333f5dfb354e4d151d7a7b5ff86 /tests/auto/qml/qmltc
parentd223f1e3a887f7b953b23b6c911ef6028755c935 (diff)
Support RegExpLiteral bindings in qmltc
Task-number: QTBUG-91956 Pick-to: 6.4 Change-Id: I02f8c6d1f0d6e4411985ffe3f22fb3c51fb36db6 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'tests/auto/qml/qmltc')
-rw-r--r--tests/auto/qml/qmltc/QmltcTests/CMakeLists.txt1
-rw-r--r--tests/auto/qml/qmltc/QmltcTests/regexpBindings.qml5
-rw-r--r--tests/auto/qml/qmltc/tst_qmltc.cpp10
-rw-r--r--tests/auto/qml/qmltc/tst_qmltc.h1
4 files changed, 17 insertions, 0 deletions
diff --git a/tests/auto/qml/qmltc/QmltcTests/CMakeLists.txt b/tests/auto/qml/qmltc/QmltcTests/CMakeLists.txt
index c7c5958b8f..a637945a2c 100644
--- a/tests/auto/qml/qmltc/QmltcTests/CMakeLists.txt
+++ b/tests/auto/qml/qmltc/QmltcTests/CMakeLists.txt
@@ -38,6 +38,7 @@ set(qml_sources
extensionTypeBindings.qml
nonStandardInclude.qml
specialProperties.qml
+ regexpBindings.qml
qtbug103956/SubComponent.qml
qtbug103956/MainComponent.qml
diff --git a/tests/auto/qml/qmltc/QmltcTests/regexpBindings.qml b/tests/auto/qml/qmltc/QmltcTests/regexpBindings.qml
new file mode 100644
index 0000000000..e1fd6de373
--- /dev/null
+++ b/tests/auto/qml/qmltc/QmltcTests/regexpBindings.qml
@@ -0,0 +1,5 @@
+import QtQuick
+
+RegularExpressionValidator {
+ regularExpression: /ab*c/
+}
diff --git a/tests/auto/qml/qmltc/tst_qmltc.cpp b/tests/auto/qml/qmltc/tst_qmltc.cpp
index e3df32d9cb..39f892c845 100644
--- a/tests/auto/qml/qmltc/tst_qmltc.cpp
+++ b/tests/auto/qml/qmltc/tst_qmltc.cpp
@@ -25,6 +25,7 @@
#include "qtbug103956_main.h"
#include "nonstandardinclude.h"
#include "specialproperties.h"
+#include "regexpbindings.h"
#include "signalhandlers.h"
#include "javascriptfunctions.h"
@@ -127,6 +128,7 @@ void tst_qmltc::initTestCase()
QUrl("qrc:/qt/qml/QmltcTests/extensionTypeBindings.qml"),
QUrl("qrc:/qt/qml/QmltcTests/nonStandardInclude.qml"),
QUrl("qrc:/qt/qml/QmltcTests/specialProperties.qml"),
+ QUrl("qrc:/qt/qml/QmltcTests/regexpBindings.qml"),
QUrl("qrc:/qt/qml/QmltcTests/qtbug103956/SubComponent.qml"),
QUrl("qrc:/qt/qml/QmltcTests/qtbug103956/MainComponent.qml"),
@@ -874,6 +876,14 @@ void tst_qmltc::specialProperties()
QCOMPARE(created.bindableZ().value(), 4.2);
}
+void tst_qmltc::regexpBindings()
+{
+ QQmlEngine e;
+ PREPEND_NAMESPACE(regexpBindings) created(&e);
+ QCOMPARE(created.regularExpression().pattern(), u"ab*c");
+ QVERIFY(created.regularExpression().match(u"abbbc"_s).hasMatch());
+}
+
void tst_qmltc::signalHandlers()
{
QQmlEngine e;
diff --git a/tests/auto/qml/qmltc/tst_qmltc.h b/tests/auto/qml/qmltc/tst_qmltc.h
index d7e832cb6f..6a4c3980bb 100644
--- a/tests/auto/qml/qmltc/tst_qmltc.h
+++ b/tests/auto/qml/qmltc/tst_qmltc.h
@@ -37,6 +37,7 @@ private slots:
void visibleAliasMethods(); // QTBUG-103956
void nonStandardIncludesInsideModule(); // QTBUG-104094
void specialProperties();
+ void regexpBindings();
void signalHandlers();
void jsFunctions();