summaryrefslogtreecommitdiff
path: root/tests/run.lua
diff options
context:
space:
mode:
Diffstat (limited to 'tests/run.lua')
-rw-r--r--tests/run.lua31
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")