summaryrefslogtreecommitdiff
path: root/tests/run.lua
diff options
context:
space:
mode:
authorJackson Moore <jacksonmoore@tuta.io>2026-09-04 12:17:08 +0200
committerJackson Moore <jacksonmoore@tuta.io>2026-09-04 12:17:08 +0200
commitc1874daa5f61c16ee05466aec15cca6971bc1277 (patch)
tree1286a0e2e6117cc39c67c83f21c6ac96a6f76be0 /tests/run.lua
parentf838dddfc1ba8ea6f1ec3b6cf5fd2c2fcedf637d (diff)
Keep Escape outside timer start
Diffstat (limited to 'tests/run.lua')
-rw-r--r--tests/run.lua30
1 files changed, 30 insertions, 0 deletions
diff --git a/tests/run.lua b/tests/run.lua
index f954b7c..ea0d207 100644
--- a/tests/run.lua
+++ b/tests/run.lua
@@ -5730,6 +5730,36 @@ test("Acquisition preserves descriptor writes after input failure", function()
same(old_target, state:get_previous_target("n"))
end)
+test("Escape acquisition stays outside highlight timer start", function()
+ local state, transitions = fresh_sequence_state()
+ local host = MemoryHost.new({
+ configuration = {
+ mark_cursor = false,
+ mark_char = true,
+ highlight_timeout_ms = 25,
+ },
+ input_packets = {
+ { kind = "special_key", name = "Escape", bytes = { 27 } },
+ },
+ })
+ local feedback = feedback_service.new({
+ host = host,
+ transitions = transitions,
+ })
+ local result = acquisition_service.new({
+ host = host,
+ transitions = transitions,
+ feedback = feedback,
+ }):acquire("f", "n", domain.Position.new(1, 1), nil, nil)
+
+ same(domain.ActionKind.ESCAPE, result.outcome.kind)
+ same(nil, state.highlight_timer)
+ same(0, #feedback:persistent_requests())
+ for _, operation in ipairs(host:operations()) do
+ falsy(operation.operation == "start_timer")
+ end
+end)
+
for _, item in ipairs(tests) do
local ok, failure = xpcall(item.body, debug.traceback)
if not ok then