summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorJackson Moore <jacksonmoore@tuta.io>2026-09-04 12:36:12 +0200
committerJackson Moore <jacksonmoore@tuta.io>2026-09-04 12:36:12 +0200
commit0a670e606d7467d62dbd31fde199159c46c54ee9 (patch)
treeb7a179309059c965e8ff029f91cac46c6ad2a45e /tests
parent38b8acb54d10b788eae127a2b4756c37a7828e88 (diff)
Register buffer feedback finalizers
Diffstat (limited to 'tests')
-rw-r--r--tests/run.lua28
1 files changed, 28 insertions, 0 deletions
diff --git a/tests/run.lua b/tests/run.lua
index 2b54ff1..2da1855 100644
--- a/tests/run.lua
+++ b/tests/run.lua
@@ -6069,6 +6069,34 @@ test("Persistent feedback stores overlay identity and anchor", function()
same(2, resource.anchor_line)
end)
+test("Persistent creation registers current-buffer finalizers", function()
+ local state, transitions = fresh_sequence_state()
+ local host = MemoryHost.new({
+ buffer = "buffer-finalized",
+ buffer_lines = { "aba" },
+ })
+ local feedback = feedback_service.new({
+ host = host,
+ transitions = transitions,
+ })
+ local shared_target = target_plan.build(target("a"), matching_policy())
+ local movement = motion_plan.build(shared_target, "f")
+ local persistent = feedback:request_persistent({
+ context = "n",
+ anchor = domain.Position.new(1, 1),
+ target_plan = shared_target,
+ motion_plan = movement,
+ window = "window-1",
+ })
+ local registration = host:event_registrations()[persistent.finalizers.identity]
+
+ same("buffer-finalized", persistent.finalizers.buffer)
+ same("buffer-finalized", state.finalizers[1].buffer)
+ list_same(feedback_service.FINALIZER_EVENTS, registration.names)
+ same("buffer-finalized", registration.options.buffer)
+ truthy(registration.active)
+end)
+
for _, item in ipairs(tests) do
local ok, failure = xpcall(item.body, debug.traceback)
if not ok then