From e192a496e9264249ff60b625453a3f1227af2221 Mon Sep 17 00:00:00 2001 From: Jackson Moore Date: Fri, 4 Sep 2026 14:14:32 +0200 Subject: Fix reset action flow --- tests/run.lua | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) (limited to 'tests/run.lua') 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") -- cgit v1.2.3