summaryrefslogtreecommitdiff
path: root/tests/run.lua
diff options
context:
space:
mode:
Diffstat (limited to 'tests/run.lua')
-rw-r--r--tests/run.lua24
1 files changed, 22 insertions, 2 deletions
diff --git a/tests/run.lua b/tests/run.lua
index 0b83ef1..22a9003 100644
--- a/tests/run.lua
+++ b/tests/run.lua
@@ -7210,11 +7210,13 @@ test("Acquiring primary coordination passes the pressed descriptor", function()
mark_char = false,
},
})
- local result = sequence_coordinator.new({
+ local coordinator = sequence_coordinator.new({
host = host,
state = state,
transitions = transitions,
- }):primary("t")
+ })
+ local invocation = coordinator:read_primary_invocation()
+ local result = coordinator:acquire_primary("t", invocation)
truthy(acquisition_service.AcquisitionResult.is(result))
truthy(result.resolved)
@@ -7264,6 +7266,24 @@ test("Primary coordination stops on each acquisition outcome", function()
end
end)
+test("Fresh primary resolution uses its initiating descriptor", function()
+ for _, pressed in ipairs({ "f", "F", "t", "T" }) do
+ fresh_sequence_state()
+ local host = MemoryHost.new({
+ buffer_lines = { "aba" },
+ input_packets = { { kind = "text", text = "a" } },
+ configuration = {
+ mark_cursor = false,
+ mark_char = false,
+ },
+ })
+ local resolution = sequence_coordinator.new({ host = host }):primary(pressed)
+ same("fresh", resolution.kind)
+ same(domain.Descriptor.from_string(pressed), resolution.effective_descriptor)
+ same(resolution.effective_descriptor, resolution.motion_plan.descriptor)
+ end
+end)
+
for _, item in ipairs(tests) do
local ok, failure = xpcall(item.body, debug.traceback)
if not ok then