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

Method testCommandRowLineRejectsEdits

tests/test_editor.cpp:368–400  ·  view source on GitHub ↗

── Test: CommandRow at line 0 rejects non-ADDR edits ──

Source from the content-addressed store, hash-verified

366
367 // ── Test: CommandRow at line 0 rejects non-ADDR edits ──
368 void testCommandRowLineRejectsEdits() {
369 m_editor->applyDocument(m_result);
370
371 // Line 0 should be the CommandRow
372 const LineMeta* lm = m_editor->metaForLine(0);
373 QVERIFY(lm);
374 QCOMPARE(lm->lineKind, LineKind::CommandRow);
375 QCOMPARE(lm->nodeId, kCommandRowId);
376 QCOMPARE(lm->nodeIdx, -1);
377
378 // Type/Name/Value should be rejected on CommandRow
379 QVERIFY(!m_editor->beginInlineEdit(EditTarget::Type, 0));
380 QVERIFY(!m_editor->beginInlineEdit(EditTarget::Name, 0));
381 QVERIFY(!m_editor->beginInlineEdit(EditTarget::Value, 0));
382 QVERIFY(!m_editor->isEditing());
383
384 // Set CommandRow text with an ADDR value (simulates controller.updateCommandRow)
385 m_editor->setCommandRowText(
386 QStringLiteral("source\u25BE \u00B7 0xD87B5E5000"));
387
388 // BaseAddress should be ALLOWED on CommandRow (ADDR field)
389 bool ok = m_editor->beginInlineEdit(EditTarget::BaseAddress, 0);
390 QVERIFY2(ok, "BaseAddress edit should be allowed on CommandRow");
391 QVERIFY(m_editor->isEditing());
392 m_editor->cancelInlineEdit();
393
394 // Source should be ALLOWED on CommandRow (SRC field)
395 ok = m_editor->beginInlineEdit(EditTarget::Source, 0);
396 QVERIFY2(ok, "Source edit should be allowed on CommandRow");
397 QVERIFY(m_editor->isEditing());
398 m_editor->cancelInlineEdit();
399 QApplication::processEvents(); // flush deferred showSourcePicker timer
400 }
401
402 // ── Test: inline edit lifecycle (begin → commit → re-edit) ──
403 void testInlineEditReEntry() {

Callers

nothing calls this directly

Calls 6

applyDocumentMethod · 0.80
metaForLineMethod · 0.80
beginInlineEditMethod · 0.80
isEditingMethod · 0.80
setCommandRowTextMethod · 0.80
cancelInlineEditMethod · 0.80

Tested by

no test coverage detected