Commit c6be0e20 authored by Harald Sitter's avatar Harald Sitter 🦄

use correct locale for thousand separator + force qlocale default

qlocale may end up picking the default too early (i.e. before init) leading
to incorrect output format. also the original expectation was wrong anyway
as neither C nor en_US would use point as thousand separator.

with the explicit qlocale call numeric format should now be more reliably
english
parent 08bb4ec7
......@@ -50,6 +50,7 @@ void ConverterRunnerTest::initTestCase()
{
setlocale(LC_ALL, "C.utf8");
qputenv("LANG", "en_US");
QLocale::setDefault(QLocale::English);
runner = new ConverterRunner(this, QVariantList());
runner->init();
}
......@@ -103,10 +104,10 @@ void ConverterRunnerTest::testCaseSensitiveUnits()
runner->match(context);
QCOMPARE(context.matches().count(), 1);
QCOMPARE(context.matches().first().text(), QStringLiteral("1.000.000.000 milliseconds (ms)"));
QCOMPARE(context.matches().first().text(), QStringLiteral("1,000,000,000 milliseconds (ms)"));
Plasma::RunnerContext context2;
context2.setQuery(QStringLiteral("1.000.000.000milliseconds>Ms"));
context2.setQuery(QStringLiteral("1,000,000,000milliseconds>Ms"));
runner->match(context2);
QCOMPARE(context2.matches().count(), 1);
QCOMPARE(context2.matches().first().text(), "1 megasecond (Ms)");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment