From fa79c6d1c815fb87086b0cdd4eb48d55fe865134 Mon Sep 17 00:00:00 2001 From: Jackson Moore Date: Fri, 4 Sep 2026 10:51:44 +0200 Subject: Commit Visual success --- tests/run.lua | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) (limited to 'tests') diff --git a/tests/run.lua b/tests/run.lua index 725fe98..743308d 100644 --- a/tests/run.lua +++ b/tests/run.lua @@ -3419,6 +3419,42 @@ test("Visual execution applies exact endpoints for every selection kind", functi end end) +test("Complete Visual execution commits landing and first-move state", function() + local state, transitions = fresh_sequence_state() + local target_value = target("x") + transitions:BeginAcquisition("v", "f") + transitions:CommitAcquiredTarget("v", target_value) + + local origin = domain.Position.new(1, 1) + local host = MemoryHost.new({ + buffer_lines = { "abx" }, + cursor = origin, + mode = "v", + selection = domain.Selection.active( + domain.SelectionKind.CHARACTER, + origin, + origin, + domain.SelectionOption.INCLUSIVE + ), + }) + local plan = motion_plan.build( + target_plan.build(target_value, matching_policy()), + "f" + ) + local outcome = motion_executor.new(host):execute( + text_topology.from_host(host), + "v", + plan, + 1, + true + ) + + same(domain.ActionKind.MOVEMENT, outcome.kind) + same(domain.Position.new(1, 3), state:get_previous_landing("v")) + falsy(state:get_first_move("v")) + same(target_value, state:get_previous_target("v")) +end) + for _, item in ipairs(tests) do local ok, failure = xpcall(item.body, debug.traceback) if not ok then -- cgit v1.2.3