MCPcopy Create free account
hub / github.com/KDE/labplot / testLocale

Method testLocale

tests/backend/Parser/ParserTest.cpp:179–191  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

177}
178
179void ParserTest::testLocale() {
180// TODO: locale test currently does not work on FreeBSD
181#ifndef __FreeBSD__
182 Parsing::Parser parser(false);
183 const QVector<QPair<QString, double>> tests{{QStringLiteral("1,"), 1.},
184 {QStringLiteral("1,5"), 1.5},
185 {QStringLiteral("1+0,5"), 1.5},
186 {QStringLiteral("2*1,5"), 3.}};
187
188 for (auto& expr : tests)
189 QCOMPARE(parser.parse(qPrintable(expr.first), "de_DE"), expr.second);
190#endif
191}
192
193///////////// Performance ////////////////////////////////
194// see https://github.com/ArashPartow/math-parser-benchmark-project

Callers

nothing calls this directly

Calls 1

parseMethod · 0.45

Tested by

no test coverage detected