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