MCPcopy Create free account
hub / github.com/IChooseYou/Reclass / testColumnSpanHitTest

Method testColumnSpanHitTest

tests/test_editor.cpp:633–677  ·  view source on GitHub ↗

── Test: column span hit-testing for cursor shape ──

Source from the content-addressed store, hash-verified

631
632 // ── Test: column span hit-testing for cursor shape ──
633 void testColumnSpanHitTest() {
634 m_editor->applyDocument(m_result);
635
636 // kFirstDataLine is a field line (UInt8), verify spans are valid
637 const LineMeta* lm = m_editor->metaForLine(kFirstDataLine);
638 QVERIFY(lm);
639 QCOMPARE(lm->lineKind, LineKind::Field);
640
641 // Type span should be valid for field lines
642 ColumnSpan ts = RcxEditor::typeSpan(*lm);
643 QVERIFY(ts.valid);
644 QVERIFY(ts.start < ts.end);
645
646 // Name span should be valid for field lines
647 ColumnSpan ns = RcxEditor::nameSpan(*lm);
648 QVERIFY(ns.valid);
649 QVERIFY(ns.start < ns.end);
650
651 // Value span should be valid for field lines
652 QString lineText;
653 int len = (int)m_editor->scintilla()->SendScintilla(
654 QsciScintillaBase::SCI_LINELENGTH, (unsigned long)kFirstDataLine);
655 QVERIFY(len > 0);
656 ColumnSpan vs = RcxEditor::valueSpan(*lm, len);
657 QVERIFY(vs.valid);
658 QVERIFY(vs.start < vs.end);
659
660 // Footer line should have no valid type/name spans
661 int footerLine = -1;
662 for (int i = 0; i < m_result.meta.size(); i++) {
663 if (m_result.meta[i].lineKind == LineKind::Footer) {
664 footerLine = i;
665 break;
666 }
667 }
668 QVERIFY(footerLine >= 0);
669 const LineMeta* flm = m_editor->metaForLine(footerLine);
670 QVERIFY(flm);
671 ColumnSpan fts = RcxEditor::typeSpan(*flm);
672 QVERIFY(!fts.valid);
673 ColumnSpan fns = RcxEditor::nameSpan(*flm);
674 QVERIFY(!fns.valid);
675 ColumnSpan fvs = RcxEditor::valueSpan(*flm, 10);
676 QVERIFY(!fvs.valid);
677 }
678
679 // ── Test: selectedNodeIndices ──
680 void testSelectedNodeIndices() {

Callers

nothing calls this directly

Calls 4

applyDocumentMethod · 0.80
metaForLineMethod · 0.80
scintillaMethod · 0.80
sizeMethod · 0.45

Tested by

no test coverage detected