From fb3112b75dd9eb548ce3c4e0eb925fcf62bb12dc Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Tue, 23 Aug 2022 02:02:54 +0200 Subject: [PATCH] [locale] Repair tests - prefers language default country (ca_ES over ca_AD) - prefers non-empty country match --- src/modules/locale/Tests.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/modules/locale/Tests.cpp b/src/modules/locale/Tests.cpp index fda58059a..7c883df05 100644 --- a/src/modules/locale/Tests.cpp +++ b/src/modules/locale/Tests.cpp @@ -307,10 +307,10 @@ LocaleTests::testLanguageDetection_data() QTest::newRow( "english (US)" ) << QStringLiteral( "en" ) << QStringLiteral( "US" ) << QStringLiteral( "en_US.UTF-8" ); QTest::newRow( "english (CA)" ) << QStringLiteral( "en" ) << QStringLiteral( "CA" ) - << QStringLiteral( "en" ); // because it's first in the list + << QStringLiteral( "en_US.UTF-8" ); QTest::newRow( "english (GB)" ) << QStringLiteral( "en" ) << QStringLiteral( "GB" ) << QStringLiteral( "en_GB.UTF-8" ); - QTest::newRow( "english (NL)" ) << QStringLiteral( "en" ) << QStringLiteral( "NL" ) << QStringLiteral( "en" ); + QTest::newRow( "english (NL)" ) << QStringLiteral( "en" ) << QStringLiteral( "NL" ) << QStringLiteral( "en_US.UTF-8" ); QTest::newRow( "portuguese (PT)" ) << QStringLiteral( "pt" ) << QStringLiteral( "PT" ) << QStringLiteral( "pt_PT.UTF-8" ); @@ -320,11 +320,11 @@ LocaleTests::testLanguageDetection_data() << QStringLiteral( "pt_BR.UTF-8" ); QTest::newRow( "catalan ()" ) << QStringLiteral( "ca" ) << QStringLiteral( "" ) - << QStringLiteral( "ca_AD.UTF-8" ); // no country given? Matches first + << QStringLiteral( "ca_ES.UTF-8" ); // no country given? Matches QLocale-default QTest::newRow( "catalan (ES)" ) << QStringLiteral( "ca" ) << QStringLiteral( "ES" ) << QStringLiteral( "ca_ES.UTF-8" ); QTest::newRow( "catalan (NL)" ) << QStringLiteral( "ca" ) << QStringLiteral( "NL" ) - << QStringLiteral( "ca_AD.UTF-8" ); + << QStringLiteral( "ca_ES.UTF-8" ); QTest::newRow( "catalan (@valencia)" ) << QStringLiteral( "ca@valencia" ) << QStringLiteral( "ES" ) << QStringLiteral( "ca_ES@valencia" ); // Prefers regional variant QTest::newRow( "catalan (@valencia_NL)" )