summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorJackson Moore <jacksonmoore@tuta.io>2026-09-04 10:48:22 +0200
committerJackson Moore <jacksonmoore@tuta.io>2026-09-04 10:48:22 +0200
commitecddf5c243a63d08b8c595ace160128c279e03b6 (patch)
tree929830bd25a22f5cfaef0eb1e44f1acf8f9bddae /tests
parent3770a731f500e9253bbcf300c213276359a15686 (diff)
Apply reached command endpoints
Diffstat (limited to 'tests')
-rw-r--r--tests/run.lua20
1 files changed, 20 insertions, 0 deletions
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