diff options
| author | Jackson Moore <jacksonmoore@tuta.io> | 2026-09-04 14:14:32 +0200 |
|---|---|---|
| committer | Jackson Moore <jacksonmoore@tuta.io> | 2026-09-04 14:14:32 +0200 |
| commit | e192a496e9264249ff60b625453a3f1227af2221 (patch) | |
| tree | ccac8668f16ee015190364bf1fb62fb82fc439b0 /tests/run.lua | |
| parent | 294d7efdf06efbaab0c68e0a2cf01185622c9241 (diff) | |
Fix reset action flow
Diffstat (limited to 'tests/run.lua')
| -rw-r--r-- | tests/run.lua | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/tests/run.lua b/tests/run.lua index fb97146..9ccb079 100644 --- a/tests/run.lua +++ b/tests/run.lua @@ -7707,6 +7707,37 @@ test("ActionFacade returns typed primary action outcomes", function() end, "clever-f: Invalid mapping 'x'") end) +test("ActionFacade Reset applies public cleanup and returns neutral", function() + local state, transitions = fresh_sequence_state() + local target_value = target("a") + local landing = domain.Position.new(1, 3) + local host = MemoryHost.new({ + buffer_lines = { "aba" }, + cursor = landing, + }) + transitions:BeginAcquisition("n", "f") + transitions:CommitAcquiredTarget("n", target_value, 25) + transitions:CommitCommandSuccess("n", landing, true) + local overlay = host:create_highlight({ + group = "CleverFChar", + window = "window-1", + positions = { landing }, + }) + transitions:AddTargetOverlay(overlay, "window-1", 1) + local timer = host:start_timer(30, function() end) + transitions:SetHighlightTimer(timer) + + local outcome = action_facade.new({ host = host }):reset() + + same(domain.ActionKind.NEUTRAL, outcome.kind) + same(landing, outcome.position) + same(nil, state:get_previous_descriptor("n")) + same(nil, state:get_previous_landing("n")) + same(target_value, state:get_previous_target("n")) + same(nil, host:highlights()[overlay]) + falsy(host:timers()[timer].active) +end) + test("Same-direction explicit coordination reads current-context state", function() local _, transitions = fresh_sequence_state() local normal_target = target("a") |
