diff options
Diffstat (limited to 'tests/run.lua')
| -rw-r--r-- | tests/run.lua | 36 |
1 files changed, 31 insertions, 5 deletions
diff --git a/tests/run.lua b/tests/run.lua index 204a0f3..945d712 100644 --- a/tests/run.lua +++ b/tests/run.lua @@ -7721,7 +7721,7 @@ test("Same-direction explicit coordination reads current-context state", functio }) local resolution = sequence_coordinator.new({ host = host }) - :repeat_same_direction() + :resolve_explicit_same() same("explicit_same", resolution.kind) same(domain.ModeContext.from_full_mode("v"), resolution.invocation.context) @@ -7742,7 +7742,7 @@ test("Opposite explicit coordination swaps current-context descriptor", function }) local resolution = sequence_coordinator.new({ host = host }) - :repeat_opposite_direction() + :resolve_explicit_opposite() same("explicit_opposite", resolution.kind) same(domain.Descriptor.swap(stored), resolution.request.descriptor) @@ -7757,8 +7757,8 @@ test("Explicit coordination keeps code-zero target fallback", function() local host = MemoryHost.new() local coordinator = sequence_coordinator.new({ host = host }) - local same_repeat = coordinator:repeat_same_direction() - local opposite_repeat = coordinator:repeat_opposite_direction() + local same_repeat = coordinator:resolve_explicit_same() + local opposite_repeat = coordinator:resolve_explicit_opposite() for _, resolution in ipairs({ same_repeat, opposite_repeat }) do falsy(resolution.request.neutral) @@ -7782,7 +7782,7 @@ test("Explicit coordination builds target and resolved motion plans", function() }) local coordinator = sequence_coordinator.new({ host = host }) - local resolution = coordinator:repeat_opposite_direction() + local resolution = coordinator:resolve_explicit_opposite() same(stored_target, resolution.target) same(domain.CaseMode.INSENSITIVE, resolution.target_plan.case_mode) @@ -7793,6 +7793,32 @@ test("Explicit coordination builds target and resolved motion plans", function() same(domain.EndpointPolicy.REGULAR, resolution.motion_plan.endpoint_policy) end) +test("Explicit repeat actions execute through the resolved motion path", function() + local state, transitions = fresh_sequence_state() + local prior_landing = domain.Position.new(1, 1) + transitions:BeginAcquisition("n", "f") + transitions:CommitAcquiredTarget("n", target("a")) + transitions:CommitCommandSuccess("n", prior_landing, true) + local host = MemoryHost.new({ + buffer_lines = { "abaca" }, + cursor = prior_landing, + count = 2, + configuration = { mark_char = false }, + emit_movement_events = false, + }) + local facade = action_facade.new({ host = host }) + + local outcome = facade:repeat_same_direction() + + same(domain.ActionKind.MOVEMENT, outcome.kind) + same(domain.Position.new(1, 5), outcome.position) + same(outcome.position, host:read_cursor()) + same(outcome.position, state:get_previous_landing("n")) + local resolution = facade:coordinator():last_explicit_resolution() + same(domain.Descriptor.FIND_FORWARD, resolution.motion_plan.descriptor) + same(2, resolution.invocation.count.value) +end) + for _, item in ipairs(tests) do local ok, failure = xpcall(item.body, debug.traceback) if not ok then |
