summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/run.lua36
1 files changed, 36 insertions, 0 deletions
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