diff options
Diffstat (limited to 'tests/auto')
-rw-r--r-- | tests/auto/corelib/tools/qregularexpression/tst_qregularexpression.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/tests/auto/corelib/tools/qregularexpression/tst_qregularexpression.cpp b/tests/auto/corelib/tools/qregularexpression/tst_qregularexpression.cpp index 5130b7cfcd..987ca519ee 100644 --- a/tests/auto/corelib/tools/qregularexpression/tst_qregularexpression.cpp +++ b/tests/auto/corelib/tools/qregularexpression/tst_qregularexpression.cpp @@ -2171,6 +2171,10 @@ void tst_QRegularExpression::wildcard_data() addRow(".???l", "test.html", 4); addRow("?", "test.html", 0); addRow("?m", "test.html", 6); + addRow("[*]", "test.html", -1); + addRow("[?]","test.html", -1); + addRow("[[]","test.h[ml", 6); + addRow("[]]","test.h]ml", 6); addRow(".h[a-z]ml", "test.html", 4); addRow(".h[A-Z]ml", "test.html", -1); addRow(".h[A-Z]ml", "test.hTml", 4); @@ -2191,9 +2195,7 @@ void tst_QRegularExpression::wildcard() QFETCH(QString, string); QFETCH(int, foundIndex); - QRegularExpression re; - re.setWildcardPattern(pattern); - + QRegularExpression re(QRegularExpression::wildcardToRegularExpression(pattern)); QRegularExpressionMatch match = re.match(string); QCOMPARE(match.capturedStart(), foundIndex); @@ -2217,11 +2219,9 @@ void tst_QRegularExpression::testInvalidWildcard_data() void tst_QRegularExpression::testInvalidWildcard() { QFETCH(QString, pattern); - - QRegularExpression re; - re.setWildcardPattern(pattern); - QFETCH(bool, isValid); + + QRegularExpression re(QRegularExpression::wildcardToRegularExpression(pattern)); QCOMPARE(re.isValid(), isValid); } |