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

Method testCommitThenReEdit

tests/test_editor.cpp:433–460  ·  view source on GitHub ↗

── Test: commit inline edit then re-edit same line ──

Source from the content-addressed store, hash-verified

431
432 // ── Test: commit inline edit then re-edit same line ──
433 void testCommitThenReEdit() {
434 m_editor->applyDocument(m_result);
435 m_editor->scintilla()->setCursorPosition(kFirstDataLine, 0);
436
437 // Begin value edit
438 bool ok = m_editor->beginInlineEdit(EditTarget::Value, kFirstDataLine);
439 QVERIFY(ok);
440 QVERIFY(m_editor->isEditing());
441
442 // Simulate Enter key → commit (via signal spy)
443 QSignalSpy spy(m_editor, &RcxEditor::inlineEditCommitted);
444 QKeyEvent enter(QEvent::KeyPress, Qt::Key_Return, Qt::NoModifier);
445 QApplication::sendEvent(m_editor->scintilla(), &enter);
446
447 // Should have emitted commit signal and exited edit mode
448 QCOMPARE(spy.count(), 1);
449 QVERIFY(!m_editor->isEditing());
450
451 // Re-apply document (simulates refresh)
452 m_editor->applyDocument(m_result);
453
454 // Must be able to edit the same line again
455 ok = m_editor->beginInlineEdit(EditTarget::Value, kFirstDataLine);
456 QVERIFY(ok);
457 QVERIFY(m_editor->isEditing());
458
459 m_editor->cancelInlineEdit();
460 }
461
462 // ── Test: mouse click during edit commits it ──
463 void testMouseClickCommitsEdit() {

Callers

nothing calls this directly

Calls 5

applyDocumentMethod · 0.80
scintillaMethod · 0.80
beginInlineEditMethod · 0.80
isEditingMethod · 0.80
cancelInlineEditMethod · 0.80

Tested by

no test coverage detected