| 366 | ///////////////////////// check group separator problem ///////////////////// |
| 367 | |
| 368 | void SpreadsheetFormulaTest::formulaLocale() { |
| 369 | Spreadsheet sheet(QStringLiteral("test"), false); |
| 370 | const int cols = 2; |
| 371 | const int rows = 3; |
| 372 | const QVector<double> xData{13000, 14000, 15000}; |
| 373 | |
| 374 | sheet.setColumnCount(cols); |
| 375 | sheet.setRowCount(rows); |
| 376 | auto* col0{sheet.column(0)}; |
| 377 | col0->replaceValues(0, xData); |
| 378 | |
| 379 | SpreadsheetView view(&sheet, false); |
| 380 | view.selectColumn(0); |
| 381 | |
| 382 | QStringList variableNames; |
| 383 | variableNames << QLatin1String("x"); |
| 384 | QVector<Column*> variableColumns; |
| 385 | variableColumns << sheet.column(0); |
| 386 | sheet.column(1)->setFormulaVariableColumn(sheet.column(0)); |
| 387 | |
| 388 | sheet.column(1)->setFormula(QLatin1String("mean(x)"), variableNames, variableColumns, true); |
| 389 | sheet.column(1)->updateFormula(); |
| 390 | |
| 391 | // values |
| 392 | for (int i = 0; i < rows; i++) |
| 393 | QCOMPARE(sheet.column(1)->valueAt(i), sheet.column(0)->valueAt(1)); |
| 394 | } |
| 395 | |
| 396 | ///////////////////////// more methods ///////////////////// |
| 397 |
nothing calls this directly
no test coverage detected