From 9a4d992778355d115a1d3cbd6b3ef7d61626e4b0 Mon Sep 17 00:00:00 2001
From: Adriaan de Groot <groot@kde.org>
Date: Tue, 23 Aug 2022 02:06:06 +0200
Subject: [PATCH] [locale] Repair tests

- Esperanto now doesn't quite self-match because it has no country
- sr prefers RS as country over ME
---
 src/modules/locale/Tests.cpp | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/modules/locale/Tests.cpp b/src/modules/locale/Tests.cpp
index 7c883df052..56327154a8 100644
--- a/src/modules/locale/Tests.cpp
+++ b/src/modules/locale/Tests.cpp
@@ -371,7 +371,7 @@ LocaleTests::testLanguageDetectionValencia()
     {
         auto r = LocaleConfiguration::fromLanguageAndLocation(
             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(
@@ -570,6 +570,10 @@ LocaleTests::testLanguageSimilarity()
             if ( self_similarity != 100 )
             {
                 cDebug() << "Locale" << l << "is unusual.";
+                if ( l == QStringLiteral( "eo" ) )
+                {
+                    QEXPECT_FAIL( "", "Esperanto has no country to match", Continue );
+                }
             }
             QCOMPARE( self_similarity, 100 );
         }
-- 
GitLab