diff options
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/run.lua | 17 |
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" } |
