diff options
author | Andrei Golubev <andrei.golubev@qt.io> | 2022-07-26 16:29:02 +0200 |
---|---|---|
committer | Andrei Golubev <andrei.golubev@qt.io> | 2022-07-29 09:20:42 +0200 |
commit | 9eccc92beab97769b0fb2f8edb871afd919ce66f (patch) | |
tree | b72af228b753741fdfee83b6d140885adfbbc4f8 /tests | |
parent | 5ffd81567f816523ce09896e2f2608238fb43bb1 (diff) |
Support RegExpLiteral bindings in qmltc
Task-number: QTBUG-91956
Change-Id: I02f8c6d1f0d6e4411985ffe3f22fb3c51fb36db6
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit 2d5f3eb86e1eed13f143173eec0cbc724ed5d9a9)
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/qml/qmltc/QmltcTests/CMakeLists.txt | 1 | ||||
-rw-r--r-- | tests/auto/qml/qmltc/QmltcTests/regexpBindings.qml | 5 | ||||
-rw-r--r-- | tests/auto/qml/qmltc/tst_qmltc.cpp | 12 | ||||
-rw-r--r-- | tests/auto/qml/qmltc/tst_qmltc.h | 1 |
4 files changed, 19 insertions, 0 deletions
diff --git a/tests/auto/qml/qmltc/QmltcTests/CMakeLists.txt b/tests/auto/qml/qmltc/QmltcTests/CMakeLists.txt index e46ca0daee..243a75e9fb 100644 --- a/tests/auto/qml/qmltc/QmltcTests/CMakeLists.txt +++ b/tests/auto/qml/qmltc/QmltcTests/CMakeLists.txt @@ -35,6 +35,7 @@ set(qml_sources extensionTypeBindings.qml nonStandardInclude.qml memberProperties.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 6d2db3a698..af0ba4878e 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 "memberproperties.h" +#include "regexpbindings.h" #include "signalhandlers.h" #include "javascriptfunctions.h" @@ -124,6 +125,9 @@ void tst_qmltc::initTestCase() QUrl("qrc:/QmltcTests/deferredProperties_attached.qml"), QUrl("qrc:/QmltcTests/deferredProperties_complex.qml"), QUrl("qrc:/QmltcTests/extensionTypeBindings.qml"), + QUrl("qrc:/QmltcTests/nonStandardInclude.qml"), + QUrl("qrc:/QmltcTests/memberProperties.qml"), + QUrl("qrc:/QmltcTests/regexpBindings.qml"), QUrl("qrc:/QmltcTests/signalHandlers.qml"), QUrl("qrc:/QmltcTests/javaScriptFunctions.qml"), @@ -847,6 +851,14 @@ void tst_qmltc::memberProperties() QCOMPARE(created.m_y, u"foo"_s); } +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 6563fb052d..31c15f5aa6 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 memberProperties(); + void regexpBindings(); void signalHandlers(); void jsFunctions(); |