diff options
| author | Jackson Moore <jacksonmoore@tuta.io> | 2026-09-04 12:16:32 +0200 |
|---|---|---|
| committer | Jackson Moore <jacksonmoore@tuta.io> | 2026-09-04 12:16:32 +0200 |
| commit | d3288bd81eb106ec0100030e6cce083231355329 (patch) | |
| tree | 6fd170ef51a4b65bcae2f4f0c07b822c3ea50657 /tests | |
| parent | 0f763ecb835fe942fd5cd6c497847322cf6dc399 (diff) | |
Suppress macro acquisition redraws
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/run.lua | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/tests/run.lua b/tests/run.lua index b4519fe..1c7d39e 100644 --- a/tests/run.lua +++ b/tests/run.lua @@ -5656,6 +5656,43 @@ test("Each macro acquisition consumes and commits input", function() same(2, reads) end) +test("Macro acquisition skips direct planning and all redraws", function() + fresh_sequence_state() + local direct_calls = 0 + local direct_planner = { + plan = function() + direct_calls = direct_calls + 1 + error("macro direct planner must stay idle") + end, + } + local host = MemoryHost.new({ + buffer_lines = { "abc" }, + configuration = { + mark_cursor = true, + mark_direct = true, + mark_char = false, + show_prompt = true, + }, + input_packets = { { kind = "text", text = "b" } }, + }) + local service = acquisition_service.new({ + host = host, + direct_planner = direct_planner, + }) + + local result = service:acquire( + "f", + "n", + domain.Position.new(1, 1), + nil, + "q" + ) + same("b", result.target.value) + same(0, direct_calls) + same(nil, service:last_temporary_scope().direct_marker) + same(0, #host:redraws()) +end) + for _, item in ipairs(tests) do local ok, failure = xpcall(item.body, debug.traceback) if not ok then |
