[locale] Repair tests

- Esperanto now doesn't quite self-match because it has no country
- sr prefers RS as country over ME

(cherry picked from commit 9a4d992778)
This commit is contained in:
Adriaan de Groot 2022-08-23 02:06:06 +02:00
parent 55bea24660
commit 7f3d3746e1

View File

@ -374,7 +374,7 @@ LocaleTests::testLanguageDetectionValencia()
{ {
auto r = LocaleConfiguration::fromLanguageAndLocation( auto r = LocaleConfiguration::fromLanguageAndLocation(
QStringLiteral( "sr" ), availableLocales, QStringLiteral( "NL" ) ); QStringLiteral( "sr" ), availableLocales, QStringLiteral( "NL" ) );
QCOMPARE( r.language(), "sr_ME" ); // Because that one is first in the list QCOMPARE( r.language(), "sr_RS" ); // Because that one is first in the list
} }
{ {
auto r = LocaleConfiguration::fromLanguageAndLocation( auto r = LocaleConfiguration::fromLanguageAndLocation(
@ -573,6 +573,10 @@ LocaleTests::testLanguageSimilarity()
if ( self_similarity != 100 ) if ( self_similarity != 100 )
{ {
cDebug() << "Locale" << l << "is unusual."; cDebug() << "Locale" << l << "is unusual.";
if ( l == QStringLiteral( "eo" ) )
{
QEXPECT_FAIL( "", "Esperanto has no country to match", Continue );
}
} }
QCOMPARE( self_similarity, 100 ); QCOMPARE( self_similarity, 100 );
} }