summaryrefslogtreecommitdiff
path: root/tests/run.lua
diff options
context:
space:
mode:
Diffstat (limited to 'tests/run.lua')
-rw-r--r--tests/run.lua29
1 files changed, 29 insertions, 0 deletions
diff --git a/tests/run.lua b/tests/run.lua
index 09a0375..97fbacb 100644
--- a/tests/run.lua
+++ b/tests/run.lua
@@ -3311,6 +3311,35 @@ test("Command success requests feedback migration before state commit", function
falsy(observed.moved_forward)
end)
+test("Complete command execution commits direction and landing", function()
+ local state, transitions = fresh_sequence_state()
+ local target_value = target("a")
+ transitions:BeginAcquisition("n", "f")
+ transitions:CommitAcquiredTarget("n", target_value)
+
+ local host = MemoryHost.new({
+ buffer_lines = { "aba" },
+ cursor = { line = 1, byte_column = 1 },
+ })
+ 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),
+ "n",
+ plan,
+ 1,
+ true
+ )
+
+ same(domain.ActionKind.MOVEMENT, outcome.kind)
+ same(domain.Position.new(1, 3), state:get_previous_landing("n"))
+ falsy(state:get_first_move("n"))
+ truthy(state.moved_forward)
+ truthy(state.moved_forward_initialized)
+end)
+
for _, item in ipairs(tests) do
local ok, failure = xpcall(item.body, debug.traceback)
if not ok then