diff options
| author | Jackson Moore <jacksonmoore@tuta.io> | 2026-09-04 17:51:24 +0200 |
|---|---|---|
| committer | Jackson Moore <jacksonmoore@tuta.io> | 2026-09-04 17:51:24 +0200 |
| commit | 0ff6af88a8b955606312c9e4d4929057b9067826 (patch) | |
| tree | 499f0ca5bea709d6ded9ec15e00844c750d634b3 /tests/run.lua | |
| parent | fae69149ec18b2f75e124976623fc99ee3cb090a (diff) | |
Roll back feedback when finalizer setup fails
Diffstat (limited to 'tests/run.lua')
| -rw-r--r-- | tests/run.lua | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/tests/run.lua b/tests/run.lua index 131086f..8b29fd3 100644 --- a/tests/run.lua +++ b/tests/run.lua @@ -6298,6 +6298,32 @@ test("Persistent feedback reuses the movement TargetPlan", function() end, "reuse the movement TargetPlan") end) +test("Persistent creation rolls back an unowned overlay", function() + local state = fresh_sequence_state() + local host = MemoryHost.new({ buffer_lines = { "ax" } }) + host.register_events = function() + error("event registration failed", 0) + end + local feedback = feedback_service.new(host) + local shared_target = target_plan.build(target("x"), matching_policy()) + local movement = motion_plan.build(shared_target, "f") + + fails(function() + feedback:request_persistent({ + context = "n", + anchor = domain.Position.new(1, 1), + target_plan = shared_target, + motion_plan = movement, + window = "window-1", + }) + end, "event registration failed") + + same(0, #state.target_overlays) + same(0, #state.finalizers) + same(0, map_size(host:highlights())) + same(0, #feedback:persistent_requests()) +end) + test("Persistent feedback uses its selected descriptor and endpoint policy", function() fresh_sequence_state() local feedback = feedback_service.new(MemoryHost.new()) |
