summaryrefslogtreecommitdiff
path: root/tests/run.lua
diff options
context:
space:
mode:
authorJackson Moore <jacksonmoore@tuta.io>2026-09-04 12:40:08 +0200
committerJackson Moore <jacksonmoore@tuta.io>2026-09-04 12:40:08 +0200
commit70a3f231cf4d8bf76c3c73584502d6a3977167b1 (patch)
tree546f189b56ebce29be848d3b1715de292572bcec /tests/run.lua
parent450f71774898d6aba1818a92bfb5035237573d16 (diff)
Cancel finalized highlight timer
Diffstat (limited to 'tests/run.lua')
-rw-r--r--tests/run.lua25
1 files changed, 25 insertions, 0 deletions
diff --git a/tests/run.lua b/tests/run.lua
index 6244677..034d037 100644
--- a/tests/run.lua
+++ b/tests/run.lua
@@ -6297,6 +6297,31 @@ test("Full finalization removes owned registrations and window overlays", functi
same(0, #state.finalizers)
end)
+test("Full finalization cancels the active highlight timer", function()
+ local state, transitions = fresh_sequence_state()
+ local host = MemoryHost.new()
+ local feedback = feedback_service.new({
+ host = host,
+ transitions = transitions,
+ })
+ local timer = host:start_timer(25, function() end)
+ transitions:SetHighlightTimer(timer)
+
+ local cleanup = feedback:full_finalize("window-1")
+
+ same(timer, cleanup.highlight_timer)
+ same(nil, state.highlight_timer)
+ falsy(host:timers()[timer].active)
+ local stopped
+ for _, operation in ipairs(host:operations()) do
+ if operation.operation == "stop_timer" and operation.identity == timer then
+ stopped = operation
+ end
+ end
+ truthy(stopped ~= nil)
+ truthy(stopped.stopped)
+end)
+
for _, item in ipairs(tests) do
local ok, failure = xpcall(item.body, debug.traceback)
if not ok then