summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorJackson Moore <jacksonmoore@tuta.io>2026-09-04 12:47:55 +0200
committerJackson Moore <jacksonmoore@tuta.io>2026-09-04 12:47:55 +0200
commitba60993e80bc7e9d770639fb31a2b681cfd99e2e (patch)
treee8bb0e54ffa2b01b37d9e405fcd6f06ec9fcf400 /tests
parent36fa529fae92038daaddc7c88ec824cc71c1ffef (diff)
Refresh resolved primary timer
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 2d343b6..2f470d8 100644
--- a/tests/run.lua
+++ b/tests/run.lua
@@ -6835,6 +6835,32 @@ test("Primary repetition restores feedback before movement", function()
truthy(create_index < movement_index)
end)
+test("Resolved primary actions refresh the highlight timer", function()
+ local state, transitions = fresh_sequence_state()
+ local host = MemoryHost.new({
+ configuration = {
+ mark_char = true,
+ highlight_timeout_ms = 15,
+ },
+ })
+ local feedback = feedback_service.new({
+ host = host,
+ transitions = transitions,
+ })
+ local resolved = target("a")
+
+ local fresh = feedback:refresh_primary(resolved, "window-1")
+ same(fresh, state.highlight_timer)
+ local repeated = feedback:refresh_primary(resolved, "window-1")
+ same(repeated, state.highlight_timer)
+ falsy(fresh == repeated)
+ falsy(host:timers()[fresh].active)
+ truthy(host:timers()[repeated].active)
+
+ same(nil, feedback:refresh_primary(nil, "window-1"))
+ same(repeated, state.highlight_timer)
+end)
+
for _, item in ipairs(tests) do
local ok, failure = xpcall(item.body, debug.traceback)
if not ok then