summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorJackson Moore <jacksonmoore@tuta.io>2026-09-04 10:29:06 +0200
committerJackson Moore <jacksonmoore@tuta.io>2026-09-04 10:29:06 +0200
commit3521acb1ddeff755e4af9c385ec0b202fa3c3333 (patch)
treed285987f430601b395a33e6fdb3247715ddf9d07 /tests
parent1a09a8909859d5c4b7c64184912cb60dc9e23a97 (diff)
Return partial destination outcomes
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 de0013f..eac53bf 100644
--- a/tests/run.lua
+++ b/tests/run.lua
@@ -2803,6 +2803,42 @@ test("Complete outcomes report the last destination after every count unit", fun
same(2, backward_outcome.successful_steps)
end)
+test("Partial outcomes retain the last intermediate destination", function()
+ local engine = destination_engine.new()
+ local find_view = text_topology.new({ "axaxa" }, "utf-8")
+ local find_plan = motion_plan.build(
+ target_plan.build(target("a"), matching_policy()),
+ "f"
+ )
+ local find_partial = engine:calculate(
+ find_view,
+ domain.Position.new(1, 1),
+ find_plan,
+ 3,
+ true
+ )
+ same(domain.SearchStatus.BOUNDARY_AFTER_PARTIAL, find_partial.status)
+ falsy(find_partial.complete)
+ same(domain.Position.new(1, 5), find_partial.endpoint)
+ same(2, find_partial.successful_steps)
+
+ local till_view = text_topology.new({ "abxb" }, "utf-8")
+ local till_plan = motion_plan.build(
+ target_plan.build(target("b"), matching_policy()),
+ "t"
+ )
+ local till_partial = engine:calculate(
+ till_view,
+ domain.Position.new(1, 1),
+ till_plan,
+ 3,
+ true
+ )
+ same(domain.SearchStatus.BOUNDARY_AFTER_PARTIAL, till_partial.status)
+ same(domain.Position.new(1, 3), till_partial.endpoint)
+ same(2, till_partial.successful_steps)
+end)
+
for _, item in ipairs(tests) do
local ok, failure = xpcall(item.body, debug.traceback)
if not ok then