diff options
Diffstat (limited to 'tests/run.lua')
| -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({ |
