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

Method testCopyPasteColumnMode00

tests/spreadsheet/SpreadsheetTest.cpp:44–69  ·  view source on GitHub ↗

Handling of different columns modes ! insert two columns with float values into an empty spreadsheet */

Source from the content-addressed store, hash-verified

42 insert two columns with float values into an empty spreadsheet
43*/
44void 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.

Callers

nothing calls this directly

Calls 9

setColumnCountMethod · 0.45
setRowCountMethod · 0.45
setTextMethod · 0.45
pasteIntoSelectionMethod · 0.45
columnCountMethod · 0.45
rowCountMethod · 0.45
columnModeMethod · 0.45
columnMethod · 0.45
valueAtMethod · 0.45

Tested by

no test coverage detected