From b3459a82c42c62442ee4d7713b0fc5f9e6a4bf82 Mon Sep 17 00:00:00 2001 From: Jackson Moore Date: Fri, 4 Sep 2026 12:07:18 +0200 Subject: Store timed acquisition clock --- tests/run.lua | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) (limited to 'tests/run.lua') diff --git a/tests/run.lua b/tests/run.lua index 603baad..fa9930e 100644 --- a/tests/run.lua +++ b/tests/run.lua @@ -5298,6 +5298,44 @@ test("Missing previous input preserves cursor and emits exact diagnostic", funct ) end) +test("Positive repeat timeout stores acquisition time", function() + local state, transitions = fresh_sequence_state() + transitions:SetRepeatTimestamp(17) + local host = MemoryHost.new({ + time_ms = 84.75, + configuration = { + mark_cursor = false, + repeat_timeout_ms = 50, + }, + input_packets = { { kind = "text", text = "a" } }, + }) + local result = acquisition_service.new({ + host = host, + transitions = transitions, + }):acquire("f", "n", domain.Position.new(1, 1), nil, nil) + same(84.75, result.acquisition_time_ms) + same(84.75, state.repeat_timestamp_ms) + + fresh_sequence_state() + transitions:SetRepeatTimestamp(17) + local zero_host = MemoryHost.new({ + configuration = { + mark_cursor = false, + repeat_timeout_ms = 0, + }, + input_packets = { { kind = "text", text = "a" } }, + }) + local zero_result = acquisition_service.new({ + host = zero_host, + transitions = transitions, + }):acquire("f", "n", domain.Position.new(1, 1), nil, nil) + same(nil, zero_result.acquisition_time_ms) + same(17, state.repeat_timestamp_ms) + for _, operation in ipairs(zero_host:operations()) do + falsy(operation.operation == "read_time_ms") + end +end) + for _, item in ipairs(tests) do local ok, failure = xpcall(item.body, debug.traceback) if not ok then -- cgit v1.2.3