From 319fee652eda9a27dfffa0a6370ef4f434927c80 Mon Sep 17 00:00:00 2001 From: Jackson Moore Date: Fri, 4 Sep 2026 14:19:05 +0200 Subject: Add fixed initiating actions --- tests/run.lua | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) (limited to 'tests/run.lua') diff --git a/tests/run.lua b/tests/run.lua index 403000a..6a8fc64 100644 --- a/tests/run.lua +++ b/tests/run.lua @@ -7800,6 +7800,38 @@ test("Failed resolved primary search still refreshes highlight timeout", functio truthy(host:timers()[state.highlight_timer].active) end) +test("Initiating action methods supply their fixed descriptors", function() + local cases = { + { method = "start_find_forward", descriptor = "f", origin = 1 }, + { method = "start_find_backward", descriptor = "F", origin = 3 }, + { method = "start_till_forward", descriptor = "t", origin = 1 }, + { method = "start_till_backward", descriptor = "T", origin = 3 }, + } + + for _, case in ipairs(cases) do + fresh_sequence_state() + local host = MemoryHost.new({ + buffer_lines = { "aaa" }, + cursor = { line = 1, byte_column = case.origin }, + input_packets = { { kind = "text", text = "a" } }, + configuration = { + mark_cursor = false, + mark_char = false, + }, + emit_movement_events = false, + }) + local facade = action_facade.new({ host = host }) + local outcome = facade[case.method](facade) + + same(domain.ActionKind.MOVEMENT, outcome.kind, case.method) + same( + domain.Descriptor.from_string(case.descriptor), + facade:coordinator():last_primary_resolution().effective_descriptor, + case.method + ) + end +end) + test("ActionFacade returns typed primary action outcomes", function() fresh_sequence_state() local host = MemoryHost.new({ -- cgit v1.2.3