diff options
| author | Jackson Moore <jacksonmoore@tuta.io> | 2026-09-04 10:21:30 +0200 |
|---|---|---|
| committer | Jackson Moore <jacksonmoore@tuta.io> | 2026-09-04 10:21:30 +0200 |
| commit | 1a9f90afcc6e5e00a94dd188a5361a894d06e257 (patch) | |
| tree | 94cf2f1226af5ecf6381c5eb908bb9efa7227ff6 /tests | |
| parent | 51d029e037f233e3239d426d151630ec4897d4fb (diff) | |
Transform backward TILL destinations
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/run.lua | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/tests/run.lua b/tests/run.lua index e11bf1f..e045a7e 100644 --- a/tests/run.lua +++ b/tests/run.lua @@ -2383,6 +2383,40 @@ test("Forward TILL destinations use target predecessors", function() truthy(view:is_valid_cursor_position(cross_line.endpoint)) end) +test("Backward TILL destinations use target successors", function() + local engine = destination_engine.new() + local same_line_view = text_topology.new({ "xabx" }, "utf-8") + local till_a = motion_plan.build( + target_plan.build(target("a"), matching_policy()), + "T" + ) + same( + domain.Position.new(1, 3), + engine:calculate( + same_line_view, + domain.Position.new(1, 4), + till_a, + 1, + true + ).endpoint + ) + + local cross_line_view = text_topology.new({ "x", "abc" }, "utf-8") + local till_x = motion_plan.build( + target_plan.build(target("x"), matching_policy()), + "T" + ) + local cross_line = engine:calculate( + cross_line_view, + domain.Position.new(2, 2), + till_x, + 1, + true + ) + same(domain.Position.new(2, 1), cross_line.endpoint) + truthy(cross_line_view:is_valid_cursor_position(cross_line.endpoint)) +end) + for _, item in ipairs(tests) do local ok, failure = xpcall(item.body, debug.traceback) if not ok then |
