diff options
author | Lars Knoll <lars.knoll@qt.io> | 2020-04-02 09:57:13 +0200 |
---|---|---|
committer | Lars Knoll <lars.knoll@qt.io> | 2020-04-03 21:01:49 +0200 |
commit | 55be24d6b6e66bd54168021f5a467ba4da73b2c6 (patch) | |
tree | 07f3165aebbe539dc506e78f1f4040471d32ab62 /tests/auto/qml/qquickworkerscript/tst_qquickworkerscript.cpp | |
parent | e1bc9db85149b89feb73f1690fd218de498b8b27 (diff) |
Remove QRegExp from qml autotests
QRegExp will get removed in Qt6. Clean up by removing dependencies
on QRegExp in the autotests.
Change-Id: I8ef8561ba30b98b61cd9ed52907b48c5969f2c49
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Diffstat (limited to 'tests/auto/qml/qquickworkerscript/tst_qquickworkerscript.cpp')
-rw-r--r-- | tests/auto/qml/qquickworkerscript/tst_qquickworkerscript.cpp | 14 |
1 files changed, 1 insertions, 13 deletions
diff --git a/tests/auto/qml/qquickworkerscript/tst_qquickworkerscript.cpp b/tests/auto/qml/qquickworkerscript/tst_qquickworkerscript.cpp index 2f79f7157f..b093dcaf07 100644 --- a/tests/auto/qml/qquickworkerscript/tst_qquickworkerscript.cpp +++ b/tests/auto/qml/qquickworkerscript/tst_qquickworkerscript.cpp @@ -138,17 +138,7 @@ void tst_QQuickWorkerScript::messaging() if (response.userType() == qMetaTypeId<QJSValue>()) response = response.value<QJSValue>().toVariant(); - if (value.type() == QMetaType::QRegExp && response.type() == QMetaType::QRegularExpression) { - // toVariant() doesn't know if we want QRegExp or QRegularExpression. It always creates - // a QRegularExpression from a JavaScript regular expression. - const QRegularExpression responseRegExp = response.toRegularExpression(); - const QRegExp valueRegExp = value.toRegExp(); - QCOMPARE(responseRegExp.pattern(), valueRegExp.pattern()); - QCOMPARE(bool(responseRegExp.patternOptions() & QRegularExpression::CaseInsensitiveOption), - bool(valueRegExp.caseSensitivity() == Qt::CaseInsensitive)); - } else { - QCOMPARE(response, value); - } + QCOMPARE(response, value); qApp->processEvents(); delete worker; @@ -165,8 +155,6 @@ void tst_QQuickWorkerScript::messaging_data() QTest::newRow("string") << QVariant::fromValue(QString("More cheeeese, Gromit!")); QTest::newRow("variant list") << QVariant::fromValue((QVariantList() << "a" << "b" << "c")); QTest::newRow("date time") << QVariant::fromValue(QDateTime::currentDateTime()); - QTest::newRow("regexp") << QVariant::fromValue(QRegExp("^\\d\\d?$", Qt::CaseInsensitive, - QRegExp::RegExp2)); QTest::newRow("regularexpression") << QVariant::fromValue(QRegularExpression( "^\\d\\d?$", QRegularExpression::CaseInsensitiveOption)); QTest::newRow("url") << QVariant::fromValue(QUrl("http://example.com/foo/bar")); |