diff options
Diffstat (limited to 'tests/run.lua')
| -rw-r--r-- | tests/run.lua | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/run.lua b/tests/run.lua index b044379..444a310 100644 --- a/tests/run.lua +++ b/tests/run.lua @@ -5933,6 +5933,26 @@ test("Persistent positions apply target predicates and endpoint transforms", fun ) end) +test("Persistent match starts stay on the anchor line", function() + fresh_sequence_state() + local host = MemoryHost.new({ buffer_lines = { "axa", "aya", "aza" } }) + local feedback = feedback_service.new(host) + local shared_target = target_plan.build(target("a"), matching_policy()) + local movement = motion_plan.build(shared_target, "f") + local persistent = feedback:build_persistent({ + context = "n", + anchor = domain.Position.new(2, 2), + target_plan = shared_target, + motion_plan = movement, + window = "window-1", + }) + + same(2, persistent.match_start_line) + same(2, #persistent.positions) + same(domain.Position.new(2, 1), persistent.positions[1]) + same(domain.Position.new(2, 3), persistent.positions[2]) +end) + for _, item in ipairs(tests) do local ok, failure = xpcall(item.body, debug.traceback) if not ok then |
