diff options
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 1249316..ed7cd33 100644 --- a/tests/run.lua +++ b/tests/run.lua @@ -5416,6 +5416,43 @@ test("Acquisition builds a fresh initiating motion plan", function() falsy(first.motion_plan == second.motion_plan) end) +test("Acquisition requests eligible persistent target feedback", function() + local _, transitions = fresh_sequence_state() + local host = MemoryHost.new({ + buffer_lines = { "aha" }, + configuration = { + mark_cursor = false, + mark_char = true, + }, + input_packets = { + { kind = "text", text = "h" }, + { kind = "text", text = "h" }, + }, + }) + local feedback = feedback_service.new({ + host = host, + transitions = transitions, + }) + local service = acquisition_service.new({ + host = host, + transitions = transitions, + feedback = feedback, + }) + local origin = domain.Position.new(1, 1) + + local normal = service:acquire("f", "n", origin, nil, nil) + truthy(normal.persistent_feedback_request ~= nil) + same(normal.target_plan, normal.persistent_feedback_request.target_plan) + same(normal.motion_plan, normal.persistent_feedback_request.motion_plan) + same("window-1", normal.persistent_feedback_request.window) + + local operator = service:acquire("f", "no", origin, nil, nil) + same(nil, operator.persistent_feedback_request) + same(1, #feedback:persistent_requests()) + truthy(feedback_service.persistent_context_eligible("n")) + falsy(feedback_service.persistent_context_eligible("no")) +end) + for _, item in ipairs(tests) do local ok, failure = xpcall(item.body, debug.traceback) if not ok then |
