summaryrefslogtreecommitdiff
path: root/tests/run.lua
diff options
context:
space:
mode:
authorJackson Moore <jacksonmoore@tuta.io>2026-09-04 12:31:28 +0200
committerJackson Moore <jacksonmoore@tuta.io>2026-09-04 12:31:28 +0200
commitd3b2783bf1ac2804336a7e1cfa02fe90e03488eb (patch)
tree716e4806cd3f15f8d7d18f4661b9c54fd5b1f918 /tests/run.lua
parent44de5ebbdea0193ef4072175795410b9d5d22afa (diff)
Build persistent target plans
Diffstat (limited to 'tests/run.lua')
-rw-r--r--tests/run.lua27
1 files changed, 27 insertions, 0 deletions
diff --git a/tests/run.lua b/tests/run.lua
index 136231d..8c66ca3 100644
--- a/tests/run.lua
+++ b/tests/run.lua
@@ -5817,6 +5817,33 @@ test("Target-plan errors remain inside acquisition cleanup guard", function()
same("search planning failed", host:diagnostics()[1].text)
end)
+test("Persistent feedback reuses the movement TargetPlan", function()
+ fresh_sequence_state()
+ local host = MemoryHost.new()
+ local feedback = feedback_service.new(host)
+ local shared_target = target_plan.build(target("a"), matching_policy())
+ local movement = motion_plan.build(shared_target, "f")
+ local persistent = feedback:build_persistent({
+ context = "n",
+ anchor = domain.Position.new(1, 1),
+ target_plan = shared_target,
+ motion_plan = movement,
+ window = "window-1",
+ })
+
+ same(shared_target, persistent.target_plan)
+ same(shared_target, persistent.motion_plan.target_plan)
+ fails(function()
+ feedback:build_persistent({
+ context = "n",
+ anchor = domain.Position.new(1, 1),
+ target_plan = target_plan.build(target("b"), matching_policy()),
+ motion_plan = movement,
+ window = "window-1",
+ })
+ end, "reuse the movement TargetPlan")
+end)
+
for _, item in ipairs(tests) do
local ok, failure = xpcall(item.body, debug.traceback)
if not ok then