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

Method testCursorShapeInFoldColumn

tests/test_editor.cpp:944–976  ·  view source on GitHub ↗

── Test: cursor is PointingHand over fold column ──

Source from the content-addressed store, hash-verified

942
943 // ── Test: cursor is PointingHand over fold column ──
944 void testCursorShapeInFoldColumn() {
945 m_editor->applyDocument(m_result);
946 QApplication::processEvents();
947
948 // Root header is suppressed; find a nested struct with foldHead
949 int foldLine = -1;
950 for (int i = 0; i < m_result.meta.size(); i++) {
951 if (m_result.meta[i].foldHead && m_result.meta[i].lineKind == LineKind::Header) {
952 foldLine = i;
953 break;
954 }
955 }
956 QVERIFY2(foldLine >= 0, "Should have at least one foldable struct header");
957
958 const LineMeta* lm = m_editor->metaForLine(foldLine);
959 QVERIFY(lm);
960 QVERIFY(lm->foldHead);
961
962 // Scroll to ensure the fold line is visible
963 m_editor->scintilla()->SendScintilla(
964 QsciScintillaBase::SCI_ENSUREVISIBLE, (unsigned long)foldLine);
965 m_editor->scintilla()->SendScintilla(
966 QsciScintillaBase::SCI_GOTOLINE, (unsigned long)foldLine);
967 QApplication::processEvents();
968
969 // Fold indicator is always at cols 0-2 (kFoldCol=3), regardless of depth
970 QPoint foldPos = colToViewport(m_editor->scintilla(), foldLine, 1);
971 QVERIFY2(foldPos.y() > 0, qPrintable(QString("Fold line %1 should be visible, got y=%2")
972 .arg(foldLine).arg(foldPos.y())));
973 sendMouseMove(m_editor->scintilla()->viewport(), foldPos);
974 QApplication::processEvents();
975 QCOMPARE(viewportCursor(m_editor), Qt::PointingHandCursor);
976 }
977
978 // ── Test: no IBeam after click then mouse-move to non-editable area ──
979 void testNoIBeamAfterClickThenMove() {

Callers

nothing calls this directly

Calls 7

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

Tested by

no test coverage detected