diff options
author | Peter Varga <pvarga@inf.u-szeged.hu> | 2020-05-26 15:43:52 +0200 |
---|---|---|
committer | Peter Varga <pvarga@inf.u-szeged.hu> | 2020-05-27 13:24:00 +0200 |
commit | a29e79b0ef958e3672964f6e8699f669d17df82d (patch) | |
tree | 1d200adb4b4763f06115ff750773072858222fd2 /tests/auto/widgets | |
parent | f5268555099a1a96f8730035a40f04a473dd396e (diff) |
Test: port qwebenginedownloaditem auto test to QRegularExpression
Leftover from
cffba828 Test: port tests to QRegularExpression
Task-number: QTBUG-72596
Change-Id: I4009bc00f24b773539a674ad5f2ba0aad1cef04b
Reviewed-by: Samuel Gaist <samuel.gaist@idiap.ch>
Diffstat (limited to 'tests/auto/widgets')
-rw-r--r-- | tests/auto/widgets/qwebenginedownloaditem/tst_qwebenginedownloaditem.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/tests/auto/widgets/qwebenginedownloaditem/tst_qwebenginedownloaditem.cpp b/tests/auto/widgets/qwebenginedownloaditem/tst_qwebenginedownloaditem.cpp index 55d8ac6e8..39948c211 100644 --- a/tests/auto/widgets/qwebenginedownloaditem/tst_qwebenginedownloaditem.cpp +++ b/tests/auto/widgets/qwebenginedownloaditem/tst_qwebenginedownloaditem.cpp @@ -1016,8 +1016,10 @@ void tst_QWebEngineDownloadItem::downloadUniqueFilenameWithTimestamp() QRegularExpressionMatch match = fileNameCheck.match(downloadedFilePath); QVERIFY(match.hasMatch()); // ISO 8601 Date and time in UTC - QRegExp timestamp("^(-?(?:[1-9][0-9]*)?[0-9]{4})-(1[0-2]|0[1-9])-(3[01]|0[1-9]|[12][0-9])T(2[0-3]|[01][0-9])([0-5][0-9])([0-5][0-9])([.][0-9]+)?(Z|[+-](?:2[0-3]|[01][0-9])[0-5][0-9])?$"); - QVERIFY(timestamp.exactMatch(match.captured(1))); + QRegularExpression timestamp("^(-?(?:[1-9][0-9]*)?[0-9]{4})-(1[0-2]|0[1-9])-(3[01]|0[1-9]|[" + "12][0-9])T(2[0-3]|[01][0-9])([0-5][0-9])([0-5][0-9])([.][0-9]" + "+)?(Z|[+-](?:2[0-3]|[01][0-9])[0-5][0-9])?$"); + QVERIFY(timestamp.match(match.captured(1)).hasMatch()); QCOMPARE(suggestedFileName, fileName); } } |