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 6a49408..97a9a6d 100644
--- a/tests/run.lua
+++ b/tests/run.lua
@@ -7656,6 +7656,32 @@ test("Escape primary action starts no highlight timer", function()
end
end)
+test("Failed resolved primary search still refreshes highlight timeout", function()
+ local state = fresh_sequence_state()
+ local origin = domain.Position.new(1, 1)
+ local host = MemoryHost.new({
+ buffer_lines = { "abc" },
+ cursor = origin,
+ input_packets = { { kind = "text", text = "z" } },
+ configuration = {
+ mark_cursor = false,
+ mark_char = true,
+ highlight_timeout_ms = 40,
+ },
+ emit_movement_events = false,
+ })
+ local coordinator = sequence_coordinator.new({ host = host })
+
+ local outcome = coordinator:primary("f")
+
+ same(domain.ActionKind.FAILED_SEARCH, outcome.kind)
+ same(origin, outcome.position)
+ same(origin, host:read_cursor())
+ truthy(state.highlight_timer ~= nil)
+ same(state.highlight_timer, coordinator:last_primary_resolution().highlight_timer)
+ truthy(host:timers()[state.highlight_timer].active)
+end)
+
for _, item in ipairs(tests) do
local ok, failure = xpcall(item.body, debug.traceback)
if not ok then