summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@qt.io>2020-04-01 10:18:10 +0200
committerLars Knoll <lars.knoll@qt.io>2020-05-09 10:39:54 +0200
commit501186daee80601d77d21d590a9fa3d6217cfbe8 (patch)
tree2a8b95af17a03ae0f967b7d2b98621d44bb66f07 /tests
parent85803440b28aadd3f4fe3e99a52e52378671b9e0 (diff)
Port linguist from QRegExp to QRegularExpression
Use the DotMatchesEverythingOption in qmakebuiltins.cpp, where we interpret .pro files, to increase compatibility with QRegExp. Change-Id: Ieb460c9647b53d6b8ca3d876e239fc8171ab7802 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/linguist/lrelease/tst_lrelease.cpp4
-rw-r--r--tests/auto/linguist/lupdate/tst_lupdate.cpp4
2 files changed, 4 insertions, 4 deletions
diff --git a/tests/auto/linguist/lrelease/tst_lrelease.cpp b/tests/auto/linguist/lrelease/tst_lrelease.cpp
index d392e51db..587d4906a 100644
--- a/tests/auto/linguist/lrelease/tst_lrelease.cpp
+++ b/tests/auto/linguist/lrelease/tst_lrelease.cpp
@@ -76,9 +76,9 @@ void tst_lrelease::doCompare(const QStringList &actual, const QString &expectedF
} else if (i == ei) {
ei = 0;
break;
- } else if (!QRegExp(expected.at(i)).exactMatch(actual.at(i))) {
+ } else if (!QRegularExpression(QRegularExpression::anchoredPattern(expected.at(i))).match(actual.at(i)).hasMatch()) {
while ((ei - 1) >= i && (gi - 1) >= i &&
- (QRegExp(expected.at(ei - 1)).exactMatch(actual.at(gi - 1))))
+ (QRegularExpression(QRegularExpression::anchoredPattern(expected.at(ei - 1))).match(actual.at(gi - 1))).hasMatch())
ei--, gi--;
break;
}
diff --git a/tests/auto/linguist/lupdate/tst_lupdate.cpp b/tests/auto/linguist/lupdate/tst_lupdate.cpp
index ac6e4db2b..14da3b46e 100644
--- a/tests/auto/linguist/lupdate/tst_lupdate.cpp
+++ b/tests/auto/linguist/lupdate/tst_lupdate.cpp
@@ -143,7 +143,7 @@ void tst_lupdate::doCompare(QStringList actual, const QString &expectedFn, bool
}
break;
}
- if (err ? !QRegExp(tmpl).exactMatch(actual.at(ai)) : (actual.at(ai) != tmpl)) {
+ if (err ? !QRegularExpression(QRegularExpression::anchoredPattern(tmpl)).match(actual.at(ai)).hasMatch() : (actual.at(ai) != tmpl)) {
if (require <= 0) {
accept = 0;
continue;
@@ -160,7 +160,7 @@ void tst_lupdate::doCompare(QStringList actual, const QString &expectedFn, bool
.arg(err ? "output" : "result")
.arg(em + 1).arg(expectedFn)));
}
- if (ai == am || (err ? !QRegExp(tmpl).exactMatch(actual.at(am - 1)) :
+ if (ai == am || (err ? !QRegularExpression(QRegularExpression::anchoredPattern(tmpl)).match(actual.at(am - 1)).hasMatch() :
(actual.at(am - 1) != tmpl))) {
if (require <= 0) {
accept = 0;