diff options
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/run.lua | 27 |
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 |
