diff options
| author | Jackson Moore <jacksonmoore@tuta.io> | 2026-09-04 10:28:33 +0200 |
|---|---|---|
| committer | Jackson Moore <jacksonmoore@tuta.io> | 2026-09-04 10:28:33 +0200 |
| commit | 1a09a8909859d5c4b7c64184912cb60dc9e23a97 (patch) | |
| tree | 1d24f7b66b7507995c6f502676d086f72ec209da /tests | |
| parent | fafe4dfe8ae5ef86ead6667f6d821c32cb5e13ed (diff) | |
Return complete destination outcomes
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/run.lua | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/tests/run.lua b/tests/run.lua index c6905b5..de0013f 100644 --- a/tests/run.lua +++ b/tests/run.lua @@ -2771,6 +2771,38 @@ test("Count calculation stops when its fixed boundary is reached", function() same(4, visits) end) +test("Complete outcomes report the last destination after every count unit", function() + local view = text_topology.new({ "ababa" }, "utf-8") + local target_match = target_plan.build(target("a"), matching_policy()) + local engine = destination_engine.new() + local forward = motion_plan.build(target_match, "f") + local backward = motion_plan.build(target_match, "F") + + local forward_outcome = engine:calculate( + view, + domain.Position.new(1, 1), + forward, + domain.Count.new(2), + true + ) + same(domain.SearchStatus.COMPLETE, forward_outcome.status) + truthy(forward_outcome.complete) + same(domain.Position.new(1, 5), forward_outcome.endpoint) + same(2, forward_outcome.successful_steps) + + local backward_outcome = engine:calculate( + view, + forward_outcome.endpoint, + backward, + 2, + false + ) + same(domain.SearchStatus.COMPLETE, backward_outcome.status) + truthy(backward_outcome.complete) + same(domain.Position.new(1, 1), backward_outcome.endpoint) + same(2, backward_outcome.successful_steps) +end) + for _, item in ipairs(tests) do local ok, failure = xpcall(item.body, debug.traceback) if not ok then |
