From e73fbb9083cdab1542dd826096e0d673989c560c Mon Sep 17 00:00:00 2001 From: Jackson Moore Date: Fri, 4 Sep 2026 13:37:18 +0200 Subject: Select fresh effective descriptors --- tests/run.lua | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) (limited to 'tests/run.lua') diff --git a/tests/run.lua b/tests/run.lua index 0b83ef1..22a9003 100644 --- a/tests/run.lua +++ b/tests/run.lua @@ -7210,11 +7210,13 @@ test("Acquiring primary coordination passes the pressed descriptor", function() mark_char = false, }, }) - local result = sequence_coordinator.new({ + local coordinator = sequence_coordinator.new({ host = host, state = state, transitions = transitions, - }):primary("t") + }) + local invocation = coordinator:read_primary_invocation() + local result = coordinator:acquire_primary("t", invocation) truthy(acquisition_service.AcquisitionResult.is(result)) truthy(result.resolved) @@ -7264,6 +7266,24 @@ test("Primary coordination stops on each acquisition outcome", function() end end) +test("Fresh primary resolution uses its initiating descriptor", function() + for _, pressed in ipairs({ "f", "F", "t", "T" }) do + fresh_sequence_state() + local host = MemoryHost.new({ + buffer_lines = { "aba" }, + input_packets = { { kind = "text", text = "a" } }, + configuration = { + mark_cursor = false, + mark_char = false, + }, + }) + local resolution = sequence_coordinator.new({ host = host }):primary(pressed) + same("fresh", resolution.kind) + same(domain.Descriptor.from_string(pressed), resolution.effective_descriptor) + same(resolution.effective_descriptor, resolution.motion_plan.descriptor) + end +end) + for _, item in ipairs(tests) do local ok, failure = xpcall(item.body, debug.traceback) if not ok then -- cgit v1.2.3