From b3cf7ada375183a24f238a3a377b7de2c5671e92 Mon Sep 17 00:00:00 2001 From: Jackson Moore Date: Fri, 4 Sep 2026 13:38:06 +0200 Subject: Evaluate primary repeat timeout --- tests/run.lua | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'tests') diff --git a/tests/run.lua b/tests/run.lua index 7caeb6c..089f6dc 100644 --- a/tests/run.lua +++ b/tests/run.lua @@ -7311,6 +7311,33 @@ test("Fresh primary resolution reuses acquired plans and marks empty motion", fu truthy(resolution.skip_destination) end) +test("Repeated primary coordination evaluates timeout before reuse", function() + local _, transitions = fresh_sequence_state() + local landing = domain.Position.new(1, 3) + transitions:BeginAcquisition("n", "f") + transitions:CommitAcquiredTarget("n", target("a"), 100) + transitions:CommitCommandSuccess("n", landing, true) + local host = MemoryHost.new({ + buffer_lines = { "aba" }, + cursor = landing, + time_values_ms = { 150 }, + configuration = { repeat_timeout_ms = 75 }, + }) + + local resolution = sequence_coordinator.new({ host = host }):primary("f") + + same("repeat", resolution.kind) + same(repeat_resolver.Decision.REPEAT, resolution.timeout.decision) + same(50, resolution.timeout.elapsed_ms) + local time_read + for index, operation in ipairs(host:operations()) do + if operation.operation == "read_time_ms" then + time_read = index + end + end + truthy(time_read ~= nil) +end) + for _, item in ipairs(tests) do local ok, failure = xpcall(item.body, debug.traceback) if not ok then -- cgit v1.2.3