|
|
|
@@ -839,6 +839,36 @@ void testWireGesturePreviewKeepsAtomicCommit() |
|
|
|
"undo must restore every cell changed by the gesture"); |
|
|
|
} |
|
|
|
|
|
|
|
void testEscapeExitsMouseWireMode() |
|
|
|
{ |
|
|
|
TestProjectStorage storage; |
|
|
|
ProjectService project_service(storage); |
|
|
|
LogicEditorService editor(project_service); |
|
|
|
LogicEditorWidget widget(editor); |
|
|
|
|
|
|
|
const auto press_escape = [&widget] |
|
|
|
{ |
|
|
|
QKeyEvent event( |
|
|
|
QEvent::KeyPress, |
|
|
|
Qt::Key_Escape, |
|
|
|
Qt::NoModifier); |
|
|
|
QApplication::sendEvent(&widget, &event); |
|
|
|
require(event.isAccepted(), "escape must be consumed by the logic editor"); |
|
|
|
}; |
|
|
|
|
|
|
|
widget.setMouseWireMode(LogicEditorWidget::MouseWireMode::Draw); |
|
|
|
press_escape(); |
|
|
|
require( |
|
|
|
widget.mouseWireMode() == LogicEditorWidget::MouseWireMode::Select, |
|
|
|
"escape must exit mouse draw mode"); |
|
|
|
|
|
|
|
widget.setMouseWireMode(LogicEditorWidget::MouseWireMode::Erase); |
|
|
|
press_escape(); |
|
|
|
require( |
|
|
|
widget.mouseWireMode() == LogicEditorWidget::MouseWireMode::Select, |
|
|
|
"escape must exit mouse erase mode"); |
|
|
|
} |
|
|
|
|
|
|
|
void testCursorAdvanceAndInlineCommandInput() |
|
|
|
{ |
|
|
|
TestProjectStorage storage; |
|
|
|
@@ -1232,6 +1262,7 @@ int main(int argc, char *argv[]) |
|
|
|
testLogicEditorGridSelectionAndDeletion(); |
|
|
|
testLadderLayoutAndDragDeletion(); |
|
|
|
testWireGesturePreviewKeepsAtomicCommit(); |
|
|
|
testEscapeExitsMouseWireMode(); |
|
|
|
testCursorAdvanceAndInlineCommandInput(); |
|
|
|
testVerticalWireShortcutAdvancesDownward(); |
|
|
|
testSegmentLevelTraceProjection(); |
|
|
|
|