From ed934ec497087b3f244b57647d0f19e3904da827 Mon Sep 17 00:00:00 2001 From: Edward Welbourne Date: Wed, 30 Apr 2025 15:19:46 +0200 Subject: [PATCH] Tweak a regex to only match what it's meant to It's testing for either a .qm extension or the end of the file-name; but it shouldn't match a .qml extension, so it should test the .qm is at the end. Thus it's a test for .qm-or-nothing at the end. Amends commit 1f2ab46745af12e4776695c1b1a2523ac170368e Change-Id: I3e47691bb7f576d21d61ce4988fc476421615add Reviewed-by: Thiago Macieira --- tests/auto/corelib/kernel/qtranslator/tst_qtranslator.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/auto/corelib/kernel/qtranslator/tst_qtranslator.cpp b/tests/auto/corelib/kernel/qtranslator/tst_qtranslator.cpp index dcf5dc1247c..792fe7bad83 100644 --- a/tests/auto/corelib/kernel/qtranslator/tst_qtranslator.cpp +++ b/tests/auto/corelib/kernel/qtranslator/tst_qtranslator.cpp @@ -251,7 +251,7 @@ void tst_QTranslator::loadLocale() for (const auto &filePath : files) QVERIFY(QFile::exists(filePath)); - const QRegularExpression localeExpr("foo-(.*)(\\.qm|$)"); + const QRegularExpression localeExpr("foo-(.*)(\\.qm|)$"); QTranslator tor; // Load the translation for the wanted locale QVERIFY(tor.load(wantedLocale, "foo", "-", path, ".qm"));