diff options
| author | Jackson Moore <jacksonmoore@tuta.io> | 2026-09-04 14:19:38 +0200 |
|---|---|---|
| committer | Jackson Moore <jacksonmoore@tuta.io> | 2026-09-04 14:19:38 +0200 |
| commit | 684a3c387f132fff9c5768f56de3a6677bfda1e7 (patch) | |
| tree | 42e021c490b0e53aad1eb18ef201a1e7e005287c /tests | |
| parent | 319fee652eda9a27dfffa0a6370ef4f434927c80 (diff) | |
Add free-form descriptor adapter
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/run.lua | 26 |
1 files changed, 26 insertions, 0 deletions
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({ |
