summaryrefslogtreecommitdiff
path: root/tests/run.lua
diff options
context:
space:
mode:
authorJackson Moore <jacksonmoore@tuta.io>2026-09-04 12:06:48 +0200
committerJackson Moore <jacksonmoore@tuta.io>2026-09-04 12:06:48 +0200
commitc22cf010d5f1f31e18514f7f5c4c17379057e40b (patch)
tree55054aa1ae85e8ecdf5215b10f045496a40a9e97 /tests/run.lua
parent6f24b9436efd6fc6139ec0382109b586238b233a (diff)
Commit resolved acquisition target
Diffstat (limited to 'tests/run.lua')
-rw-r--r--tests/run.lua17
1 files changed, 13 insertions, 4 deletions
diff --git a/tests/run.lua b/tests/run.lua
index 55a4225..603baad 100644
--- a/tests/run.lua
+++ b/tests/run.lua
@@ -5082,6 +5082,12 @@ test("Acquisition begins sequence state before input", function()
configuration = { mark_cursor = false },
input_packets = { { kind = "text", text = "a" } },
})
+ local original_read_input = host.read_input
+ local record_at_read
+ function host:read_input()
+ record_at_read = state:get_context("no")
+ return original_read_input(self)
+ end
acquisition_service.new({
host = host,
transitions = transitions,
@@ -5093,10 +5099,11 @@ test("Acquisition begins sequence state before input", function()
nil
)
+ same(domain.Descriptor.TILL_BACKWARD, record_at_read.previous_descriptor)
+ truthy(record_at_read.first_move)
+ same(nil, record_at_read.previous_target)
local record = state:get_context("no")
- same(domain.Descriptor.TILL_BACKWARD, record.previous_descriptor)
- truthy(record.first_move)
- same(nil, record.previous_target)
+ same("a", record.previous_target.value)
end)
test("Acquisition reads one raw packet after sequence start", function()
@@ -5212,7 +5219,7 @@ test("Acquisition normalizes ordinary input to editor characters", function()
end)
test("Acquisition compares first codes with previous-input triggers", function()
- local _, transitions = fresh_sequence_state()
+ local state, transitions = fresh_sequence_state()
transitions:BeginAcquisition("v", "f")
transitions:CommitAcquiredTarget(
"v",
@@ -5248,6 +5255,8 @@ test("Acquisition compares first codes with previous-input triggers", function()
same("x", service:last_temporary_scope().acquired_target.value)
same(result.cached_target, service:last_temporary_scope().resolved_target)
same(result.cached_target, result.target)
+ same(result.target, state:get_previous_target("n"))
+ same(domain.ModeContext.from_full_mode("n"), state.last_input_context)
local trigger, index = acquisition_service.match_previous_input_trigger(
0x3042,
{ "x", "\227\129\130more" }