summaryrefslogtreecommitdiff
path: root/tests/run.lua
diff options
context:
space:
mode:
authorJackson Moore <jacksonmoore@tuta.io>2026-09-04 13:45:27 +0200
committerJackson Moore <jacksonmoore@tuta.io>2026-09-04 13:45:27 +0200
commitab2fca82cf676583efc9a5897de0dd7f07c053ef (patch)
treef674f9caf1d19f1d20ac4535f9e8cc918d2f923b /tests/run.lua
parentecf11c00fb9b61d5c3fb1bf4e2bf933fc628a800 (diff)
Return outcomes through ActionFacade
Diffstat (limited to 'tests/run.lua')
-rw-r--r--tests/run.lua24
1 files changed, 24 insertions, 0 deletions
diff --git a/tests/run.lua b/tests/run.lua
index 97a9a6d..7e49e62 100644
--- a/tests/run.lua
+++ b/tests/run.lua
@@ -7,6 +7,7 @@ package.path = table.concat({
}, ";")
local domain = require("clever_f.domain")
+local action_facade = require("clever_f.action_facade")
local acquisition_service = require("clever_f.acquisition_service")
local capabilities = require("clever_f.capabilities")
local destination_engine = require("clever_f.destination_engine")
@@ -7682,6 +7683,29 @@ test("Failed resolved primary search still refreshes highlight timeout", functio
truthy(host:timers()[state.highlight_timer].active)
end)
+test("ActionFacade returns typed primary action outcomes", function()
+ fresh_sequence_state()
+ local host = MemoryHost.new({
+ buffer_lines = { "aba" },
+ input_packets = { { kind = "text", text = "b" } },
+ configuration = {
+ mark_cursor = false,
+ mark_char = false,
+ },
+ emit_movement_events = false,
+ })
+ local facade = action_facade.new({ host = host })
+
+ local outcome = facade:primary("f")
+
+ truthy(domain.ActionOutcome.is(outcome))
+ same(domain.ActionKind.MOVEMENT, outcome.kind)
+ same(domain.Position.new(1, 2), outcome.position)
+ fails(function()
+ facade:primary("x")
+ end, "clever-f: Invalid mapping 'x'")
+end)
+
for _, item in ipairs(tests) do
local ok, failure = xpcall(item.body, debug.traceback)
if not ok then