diff options
| author | Jackson Moore <jacksonmoore@tuta.io> | 2026-09-04 12:45:58 +0200 |
|---|---|---|
| committer | Jackson Moore <jacksonmoore@tuta.io> | 2026-09-04 12:45:58 +0200 |
| commit | 1c2e6fc2638a57336ca0a2e5ae1fbe8015fc3dc3 (patch) | |
| tree | c781b1cbfd5788e57aa83f722db0d3ac3c9f663c | |
| parent | eee2fe5b78d903045d92efb33354107d600f8107 (diff) | |
Preserve timer-cleaned movement history
| -rw-r--r-- | tests/run.lua | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/tests/run.lua b/tests/run.lua index cdda346..0e33c03 100644 --- a/tests/run.lua +++ b/tests/run.lua @@ -6699,6 +6699,45 @@ test("Current timer callback clears timer and character overlays", function() falsy(host:timers()[timer].active) end) +test("Timer cleanup preserves primary movement history", function() + local state, transitions = fresh_sequence_state() + local landing = domain.Position.new(1, 3) + local target_value = target("a") + local host = MemoryHost.new({ + buffer_lines = { "aba" }, + configuration = { + mark_char = true, + highlight_timeout_ms = 20, + }, + }) + local feedback = feedback_service.new({ + host = host, + transitions = transitions, + }) + local shared_target = target_plan.build(target_value, matching_policy()) + local movement = motion_plan.build(shared_target, "f") + transitions:BeginAcquisition("n", "f") + transitions:CommitAcquiredTarget("n", target_value) + transitions:CommitCommandSuccess("n", landing, true) + feedback:request_persistent({ + context = "n", + anchor = domain.Position.new(1, 1), + target_plan = shared_target, + motion_plan = movement, + window = "window-1", + }) + local timer = feedback:start_highlight_timer("window-1") + + host:fire_timer(timer) + + same(domain.Descriptor.FIND_FORWARD, state:get_previous_descriptor("n")) + same(target_value, state:get_previous_target("n")) + same(landing, state:get_previous_landing("n")) + falsy(state:get_first_move("n")) + truthy(state.moved_forward) + same(domain.ModeContext.from_full_mode("n"), state.last_input_context) +end) + for _, item in ipairs(tests) do local ok, failure = xpcall(item.body, debug.traceback) if not ok then |
