From 385be6c13c70bc458b13f000cbc59f07fb963182 Mon Sep 17 00:00:00 2001 From: Jackson Moore Date: Fri, 4 Sep 2026 11:57:51 +0200 Subject: Create enabled acquisition cursor marker --- tests/run.lua | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'tests') 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 -- cgit v1.2.3