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 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 |
