From ecddf5c243a63d08b8c595ace160128c279e03b6 Mon Sep 17 00:00:00 2001 From: Jackson Moore Date: Fri, 4 Sep 2026 10:48:22 +0200 Subject: Apply reached command endpoints --- tests/run.lua | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'tests/run.lua') diff --git a/tests/run.lua b/tests/run.lua index 938d21a..65d831b 100644 --- a/tests/run.lua +++ b/tests/run.lua @@ -3173,6 +3173,26 @@ test("Command execution saves its origin before destination calculation", functi same(domain.Position.new(1, 1), outcome.position) end) +test("Command execution applies the last reached count endpoint", function() + local host = MemoryHost.new({ + buffer_lines = { "axaxa" }, + cursor = { line = 1, byte_column = 1 }, + }) + local view = text_topology.from_host(host) + local executor = motion_executor.new(host) + local plan = motion_plan.build( + target_plan.build(target("a"), matching_policy()), + "f" + ) + + local outcome = executor:execute(view, "n", plan, 3, true) + same(domain.ActionKind.FAILED_SEARCH, outcome.kind) + same(domain.SearchStatus.BOUNDARY_AFTER_PARTIAL, outcome.search_outcome.status) + same(2, outcome.successful_steps) + same(domain.Position.new(1, 5), host:read_cursor()) + same(domain.Position.new(1, 5), outcome.position) +end) + for _, item in ipairs(tests) do local ok, failure = xpcall(item.body, debug.traceback) if not ok then -- cgit v1.2.3