diff options
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/run.lua | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/tests/run.lua b/tests/run.lua index 8c66ca3..57f4988 100644 --- a/tests/run.lua +++ b/tests/run.lua @@ -5844,6 +5844,34 @@ test("Persistent feedback reuses the movement TargetPlan", function() end, "reuse the movement TargetPlan") end) +test("Persistent feedback uses its selected descriptor and endpoint policy", function() + fresh_sequence_state() + local feedback = feedback_service.new(MemoryHost.new()) + local shared_target = target_plan.build(target("a"), matching_policy()) + local movement = motion_plan.build(shared_target, "f") + local inherited = feedback:build_persistent({ + context = "n", + anchor = domain.Position.new(1, 1), + target_plan = shared_target, + motion_plan = movement, + window = "window-1", + }) + same(domain.Descriptor.FIND_FORWARD, inherited.descriptor) + same(domain.EndpointPolicy.REGULAR, inherited.endpoint_policy) + + local selected = feedback:build_persistent({ + context = "v", + anchor = domain.Position.new(1, 1), + target_plan = shared_target, + motion_plan = movement, + descriptor = "T", + endpoint_policy = domain.EndpointPolicy.VISUAL_EXCLUSIVE, + window = "window-1", + }) + same(domain.Descriptor.TILL_BACKWARD, selected.descriptor) + same(domain.EndpointPolicy.VISUAL_EXCLUSIVE, selected.endpoint_policy) +end) + for _, item in ipairs(tests) do local ok, failure = xpcall(item.body, debug.traceback) if not ok then |
