summaryrefslogtreecommitdiff
path: root/tests/run.lua
diff options
context:
space:
mode:
authorJackson Moore <jacksonmoore@tuta.io>2026-09-04 12:10:40 +0200
committerJackson Moore <jacksonmoore@tuta.io>2026-09-04 12:10:40 +0200
commit9a41328135ab2073d087de44ba577335d109c641 (patch)
treefb2397e8eb396c06ebb209216de58a6b3bc4a1aa /tests/run.lua
parentb47d670d7613800633c91f9b22615fbd9f65c0de (diff)
Request eligible persistent feedback
Diffstat (limited to 'tests/run.lua')
-rw-r--r--tests/run.lua37
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