From 684a3c387f132fff9c5768f56de3a6677bfda1e7 Mon Sep 17 00:00:00 2001 From: Jackson Moore Date: Fri, 4 Sep 2026 14:19:38 +0200 Subject: Add free-form descriptor adapter --- tests/run.lua | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'tests') diff --git a/tests/run.lua b/tests/run.lua index 6a8fc64..08771db 100644 --- a/tests/run.lua +++ b/tests/run.lua @@ -7832,6 +7832,32 @@ test("Initiating action methods supply their fixed descriptors", function() end end) +test("Free-form action adapter accepts every valid descriptor", function() + local origins = { f = 1, F = 3, t = 1, T = 3 } + for _, descriptor in ipairs({ "f", "F", "t", "T" }) do + local state = fresh_sequence_state() + local host = MemoryHost.new({ + buffer_lines = { "aaa" }, + cursor = { line = 1, byte_column = origins[descriptor] }, + input_packets = { { kind = "text", text = "a" } }, + configuration = { + mark_cursor = false, + mark_char = false, + }, + emit_movement_events = false, + }) + local root = composition_root.new({ host = host }) + local outcome = root:invoke_descriptor(descriptor) + + same(domain.ActionKind.MOVEMENT, outcome.kind, descriptor) + same( + domain.Descriptor.from_string(descriptor), + state:get_previous_descriptor("n"), + descriptor + ) + end +end) + test("ActionFacade returns typed primary action outcomes", function() fresh_sequence_state() local host = MemoryHost.new({ -- cgit v1.2.3