diff options
| author | Jackson Moore <jacksonmoore@tuta.io> | 2026-09-04 12:31:55 +0200 |
|---|---|---|
| committer | Jackson Moore <jacksonmoore@tuta.io> | 2026-09-04 12:31:55 +0200 |
| commit | a32ac60fad13db062f23478e8da74d5dbba0edc8 (patch) | |
| tree | 007666e4cfdaf2af7b7c95ca357bc77e049693ce /tests | |
| parent | d3b2783bf1ac2804336a7e1cfa02fe90e03488eb (diff) | |
Select persistent endpoint behavior
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 |
