| 177 | } |
| 178 | |
| 179 | void 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 |