Handling of different columns modes ! insert two columns with float values into an empty spreadsheet */
| 42 | insert two columns with float values into an empty spreadsheet |
| 43 | */ |
| 44 | void SpreadsheetTest::testCopyPasteColumnMode00() { |
| 45 | QLocale::setDefault(QLocale::C); // . as decimal separator |
| 46 | Spreadsheet sheet(QStringLiteral("test"), false); |
| 47 | sheet.setColumnCount(2); |
| 48 | sheet.setRowCount(100); |
| 49 | |
| 50 | const QString str = QStringLiteral("10.0 100.0\n20.0 200.0"); |
| 51 | QApplication::clipboard()->setText(str); |
| 52 | |
| 53 | SpreadsheetView view(&sheet, false); |
| 54 | view.pasteIntoSelection(); |
| 55 | |
| 56 | // spreadsheet size |
| 57 | QCOMPARE(sheet.columnCount(), 2); |
| 58 | QCOMPARE(sheet.rowCount(), 100); |
| 59 | |
| 60 | // column modes |
| 61 | QCOMPARE(sheet.column(0)->columnMode(), AbstractColumn::ColumnMode::Double); |
| 62 | QCOMPARE(sheet.column(1)->columnMode(), AbstractColumn::ColumnMode::Double); |
| 63 | |
| 64 | // values |
| 65 | QCOMPARE(sheet.column(0)->valueAt(0), 10.0); |
| 66 | QCOMPARE(sheet.column(1)->valueAt(0), 100.0); |
| 67 | QCOMPARE(sheet.column(0)->valueAt(1), 20.0); |
| 68 | QCOMPARE(sheet.column(1)->valueAt(1), 200.0); |
| 69 | } |
| 70 | |
| 71 | /*! |
| 72 | insert one column with integer and one column with big integer values into an empty spreadsheet. |
nothing calls this directly
no test coverage detected