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 <thiago.macieira@intel.com>
This commit is contained in:
Edward Welbourne 2025-04-30 15:19:46 +02:00
parent dabc113cc8
commit ed934ec497

View File

@ -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"));