summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorJackson Moore <jacksonmoore@tuta.io>2026-09-04 11:57:51 +0200
committerJackson Moore <jacksonmoore@tuta.io>2026-09-04 11:57:51 +0200
commit385be6c13c70bc458b13f000cbc59f07fb963182 (patch)
tree952a1948d203d00aeb3c82b603c9c4fee5cb019a /tests
parentdec674e613fefd0b4cf764f121322dcaa1976031 (diff)
Create enabled acquisition cursor marker
Diffstat (limited to 'tests')
-rw-r--r--tests/run.lua27
1 files changed, 27 insertions, 0 deletions
diff --git a/tests/run.lua b/tests/run.lua
index 951210a..87f54b3 100644
--- a/tests/run.lua
+++ b/tests/run.lua
@@ -4897,6 +4897,7 @@ test("Acquisition accepts complete initiating action inputs", function()
end)
test("Acquisition starts one temporary resource scope", function()
+ fresh_sequence_state()
local service = acquisition_service.new(MemoryHost.new())
local request = service:acquire(
"f",
@@ -4914,6 +4915,32 @@ test("Acquisition starts one temporary resource scope", function()
same(1, service:started_scope_count())
end)
+test("Acquisition creates cursor markers only when enabled", function()
+ local state, transitions = fresh_sequence_state()
+ local host = MemoryHost.new({
+ cursor = { line = 1, byte_column = 4 },
+ configuration = { mark_cursor = true },
+ })
+ local service = acquisition_service.new({
+ host = host,
+ transitions = transitions,
+ })
+
+ service:acquire("F", "n", host:read_cursor(), nil, nil)
+ local marker = service:last_temporary_scope().cursor_marker
+ truthy(marker ~= nil)
+ same(domain.Position.new(1, 4), marker.position)
+ same("window-1", marker.window)
+ same(marker.identity, state:temporary_overlay_identities()[1])
+
+ fresh_sequence_state()
+ local disabled = acquisition_service.new(MemoryHost.new({
+ configuration = { mark_cursor = false },
+ }))
+ disabled:acquire("f", "n", domain.Position.new(1, 1), nil, nil)
+ same(nil, disabled:last_temporary_scope().cursor_marker)
+end)
+
for _, item in ipairs(tests) do
local ok, failure = xpcall(item.body, debug.traceback)
if not ok then