summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorJackson Moore <jacksonmoore@tuta.io>2026-09-04 14:19:05 +0200
committerJackson Moore <jacksonmoore@tuta.io>2026-09-04 14:19:05 +0200
commit319fee652eda9a27dfffa0a6370ef4f434927c80 (patch)
tree2a1dd9cc88020c6d37a211aa61a97dd196486e7e /tests
parent5e2146af55a73b8d34596c2f28e6d7fc83a959ea (diff)
Add fixed initiating actions
Diffstat (limited to 'tests')
-rw-r--r--tests/run.lua32
1 files changed, 32 insertions, 0 deletions
diff --git a/tests/run.lua b/tests/run.lua
index 403000a..6a8fc64 100644
--- a/tests/run.lua
+++ b/tests/run.lua
@@ -7800,6 +7800,38 @@ test("Failed resolved primary search still refreshes highlight timeout", functio
truthy(host:timers()[state.highlight_timer].active)
end)
+test("Initiating action methods supply their fixed descriptors", function()
+ local cases = {
+ { method = "start_find_forward", descriptor = "f", origin = 1 },
+ { method = "start_find_backward", descriptor = "F", origin = 3 },
+ { method = "start_till_forward", descriptor = "t", origin = 1 },
+ { method = "start_till_backward", descriptor = "T", origin = 3 },
+ }
+
+ for _, case in ipairs(cases) do
+ fresh_sequence_state()
+ local host = MemoryHost.new({
+ buffer_lines = { "aaa" },
+ cursor = { line = 1, byte_column = case.origin },
+ input_packets = { { kind = "text", text = "a" } },
+ configuration = {
+ mark_cursor = false,
+ mark_char = false,
+ },
+ emit_movement_events = false,
+ })
+ local facade = action_facade.new({ host = host })
+ local outcome = facade[case.method](facade)
+
+ same(domain.ActionKind.MOVEMENT, outcome.kind, case.method)
+ same(
+ domain.Descriptor.from_string(case.descriptor),
+ facade:coordinator():last_primary_resolution().effective_descriptor,
+ case.method
+ )
+ end
+end)
+
test("ActionFacade returns typed primary action outcomes", function()
fresh_sequence_state()
local host = MemoryHost.new({