diff options
Diffstat (limited to 'tests/run.lua')
| -rw-r--r-- | tests/run.lua | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/tests/run.lua b/tests/run.lua index 17749c9..403000a 100644 --- a/tests/run.lua +++ b/tests/run.lua @@ -7156,6 +7156,37 @@ test("Core activation installs sampled eager window hooks", function() same(nil, disabled.feedback.eager_registration) end) +test("Core activation exposes all seven logical actions", function() + fresh_sequence_state() + local host = MemoryHost.new({ + buffer_lines = { "aba" }, + input_packets = { { kind = "text", text = "b" } }, + configuration = { + mark_cursor = false, + mark_char = false, + }, + emit_movement_events = false, + }) + local activation = composition_root.new({ host = host }):activate() + + same(7, #composition_root.ACTION_NAMES) + local registered = {} + for _, operation in ipairs(host:operations()) do + if operation.operation == "register_action" then + registered[#registered + 1] = operation.name + end + end + list_same(composition_root.ACTION_NAMES, registered) + for _, name in ipairs(composition_root.ACTION_NAMES) do + same(name, activation.actions[name]) + end + + local outcome = host:invoke_action("StartFindForward") + same(domain.ActionKind.MOVEMENT, outcome.kind) + same(domain.Position.new(1, 2), outcome.position) + same(domain.ActionKind.NEUTRAL, host:invoke_action("Reset").kind) +end) + test("Primary coordination accepts only the four motion descriptors", function() local coordinator = sequence_coordinator.new({ host = MemoryHost.new() }) for _, value in ipairs({ "f", "F", "t", "T" }) do |
