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

Method testCursorShapeOverText

tests/test_editor.cpp:899–923  ·  view source on GitHub ↗

── Test: cursor is IBeam only over trimmed name text, Arrow over padding ──

Source from the content-addressed store, hash-verified

897
898 // ── Test: cursor is IBeam only over trimmed name text, Arrow over padding ──
899 void testCursorShapeOverText() {
900 m_editor->applyDocument(m_result);
901
902 // kFirstDataLine is a field (UInt8 InheritedAddressSpace)
903 const LineMeta* lm = m_editor->metaForLine(kFirstDataLine);
904 QVERIFY(lm);
905
906 // Get the name span (padded to kColName width)
907 ColumnSpan ns = RcxEditor::nameSpan(*lm, lm->effectiveTypeW, lm->effectiveNameW);
908 QVERIFY(ns.valid);
909
910 // Move mouse to the start of the name span (should be over text)
911 QPoint textPos = colToViewport(m_editor->scintilla(), kFirstDataLine, ns.start + 1);
912 sendMouseMove(m_editor->scintilla()->viewport(), textPos);
913 QApplication::processEvents();
914 QCOMPARE(viewportCursor(m_editor), Qt::IBeamCursor);
915
916 // Move mouse to far padding area (past end of text, within padded span)
917 // The padded span ends at ns.end but the trimmed text is shorter
918 QPoint padPos = colToViewport(m_editor->scintilla(), kFirstDataLine, ns.end - 1);
919 sendMouseMove(m_editor->scintilla()->viewport(), padPos);
920 QApplication::processEvents();
921 // Should be Arrow (padding whitespace, not actual text)
922 QCOMPARE(viewportCursor(m_editor), Qt::ArrowCursor);
923 }
924
925 // ── Test: cursor is PointingHand over type column text ──
926 void testCursorShapeOverType() {

Callers

nothing calls this directly

Calls 6

colToViewportFunction · 0.85
sendMouseMoveFunction · 0.85
viewportCursorFunction · 0.85
applyDocumentMethod · 0.80
metaForLineMethod · 0.80
scintillaMethod · 0.80

Tested by

no test coverage detected