summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/run.lua26
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())