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

Method testPaddingLineRejectsValueSpan

tests/test_editor.cpp:792–816  ·  view source on GitHub ↗

── Test: resolvedSpanFor rejects Value on Padding (defense-in-depth) ──

Source from the content-addressed store, hash-verified

790
791 // ── Test: resolvedSpanFor rejects Value on Padding (defense-in-depth) ──
792 void testPaddingLineRejectsValueSpan() {
793 m_editor->applyDocument(m_result);
794
795 // Find a Padding line
796 int paddingLine = -1;
797 for (int i = 0; i < m_result.meta.size(); i++) {
798 if (m_result.meta[i].nodeKind == NodeKind::Padding &&
799 m_result.meta[i].lineKind == LineKind::Field) {
800 paddingLine = i;
801 break;
802 }
803 }
804 QVERIFY(paddingLine >= 0);
805
806 const LineMeta* lm = m_editor->metaForLine(paddingLine);
807 QVERIFY(lm);
808
809 // valueSpanFor returns valid (shared with Hex via KF_HexPreview)
810 ColumnSpan vs = RcxEditor::valueSpan(*lm, 200);
811 QVERIFY2(vs.valid, "valueSpanFor should return valid for Padding (shared HexPreview flag)");
812
813 // But beginInlineEdit should still reject it
814 QVERIFY(!m_editor->beginInlineEdit(EditTarget::Value, paddingLine));
815 QVERIFY(!m_editor->isEditing());
816 }
817
818 // ── Test: value edit commit fires signal with typed text ──
819 void testValueEditCommitUpdatesSignal() {

Callers

nothing calls this directly

Calls 5

applyDocumentMethod · 0.80
metaForLineMethod · 0.80
beginInlineEditMethod · 0.80
isEditingMethod · 0.80
sizeMethod · 0.45

Tested by

no test coverage detected