summaryrefslogtreecommitdiffstats
path: root/tests/auto/corelib/tools/qregexp/tst_qregexp.cpp
diff options
context:
space:
mode:
authorAlexandru Croitor <alexandru.croitor@qt.io>2019-07-11 17:17:13 +0200
committerAlexandru Croitor <alexandru.croitor@qt.io>2019-07-11 17:17:51 +0200
commit4dac45c9ee59ff6586d90d423654da91523ab679 (patch)
treecd4a4adf2cbc9e77bf86d2d11e71ec66afdf3be4 /tests/auto/corelib/tools/qregexp/tst_qregexp.cpp
parent078cd61751aeaa310d35a3d596a21a36004a1a0f (diff)
parentf44850b5c3464cdda0ee9b1ee858d95f3ffaa3e2 (diff)
Merge remote-tracking branch 'origin/wip/qt6' into wip/cmake
Diffstat (limited to 'tests/auto/corelib/tools/qregexp/tst_qregexp.cpp')
-rw-r--r--tests/auto/corelib/tools/qregexp/tst_qregexp.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/auto/corelib/tools/qregexp/tst_qregexp.cpp b/tests/auto/corelib/tools/qregexp/tst_qregexp.cpp
index a98d37d733..a8111af6c1 100644
--- a/tests/auto/corelib/tools/qregexp/tst_qregexp.cpp
+++ b/tests/auto/corelib/tools/qregexp/tst_qregexp.cpp
@@ -834,6 +834,13 @@ void tst_QRegExp::testEscapingWildcard_data(){
QTest::newRow("a true '\\' in input") << "\\Qt;" << "\\Qt;" << true;
QTest::newRow("two true '\\' in input") << "\\\\Qt;" << "\\\\Qt;" << true;
QTest::newRow("a '\\' at the end") << "\\\\Qt;\\" << "\\\\Qt;\\" << true;
+
+ QTest::newRow("[]\\] matches ]") << "[]\\]" << "]" << true;
+ QTest::newRow("[]\\] matches \\") << "[]\\]" << "\\" << true;
+ QTest::newRow("[]\\] does not match [") << "[]\\]" << "[" << false;
+ QTest::newRow("[]\\]a matches ]a") << "[]\\]a" << "]a" << true;
+ QTest::newRow("[]\\]a matches \\a") << "[]\\]a" << "\\a" << true;
+ QTest::newRow("[]\\]a does not match [a") << "[]\\]a" << "[a" << false;
}
void tst_QRegExp::testEscapingWildcard(){