Paste P421

localized number tests
ActivePublic

Authored by ngraham on Jun 24 2019, 11:19 AM.
diff --git a/autotests/klocalizedstringtest.cpp b/autotests/klocalizedstringtest.cpp
index e68ec32..e1863c4 100644
--- a/autotests/klocalizedstringtest.cpp
+++ b/autotests/klocalizedstringtest.cpp
@@ -218,6 +218,12 @@ void KLocalizedStringTest::correctSubs()
QString(" 42"));
QCOMPARE(ki18n("%1").subs(42, -5, 10, QChar('_')).toString(),
QString("42___"));
+
+ QLocale::setDefault(QLocale(QLocale::French));
+ QCOMPARE(ki18n("%1").subs(4.2, 5, 'f', 2).toString(),
+ QString(" 4,20"));
+
+ QLocale::setDefault(QLocale(QLocale::English, QLocale::UnitedStates));
QCOMPARE(ki18n("%1").subs(4.2, 5, 'f', 2).toString(),
QString(" 4.20"));
}
ngraham created this paste.Jun 24 2019, 11:19 AM
ngraham created this object in space S1 KDE Community.