From 51d029e037f233e3239d426d151630ec4897d4fb Mon Sep 17 00:00:00 2001 From: Jackson Moore Date: Fri, 4 Sep 2026 10:20:59 +0200 Subject: Transform forward TILL destinations --- tests/run.lua | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) (limited to 'tests') diff --git a/tests/run.lua b/tests/run.lua index 183c9af..e11bf1f 100644 --- a/tests/run.lua +++ b/tests/run.lua @@ -2347,6 +2347,42 @@ test("FIND destinations use matching target positions", function() ) end) +test("Forward TILL destinations use target predecessors", function() + local view = text_topology.new({ + "poge huga hiyo poyo", + "x", + }, "utf-8") + local engine = destination_engine.new() + local till_h = motion_plan.build( + target_plan.build(target("h"), matching_policy()), + "t" + ) + same( + domain.Position.new(1, 5), + engine:calculate( + view, + domain.Position.new(1, 1), + till_h, + 1, + true + ).endpoint + ) + + local till_x = motion_plan.build( + target_plan.build(target("x"), matching_policy()), + "t" + ) + local cross_line = engine:calculate( + view, + domain.Position.new(1, 18), + till_x, + 1, + true + ) + same(domain.Position.new(1, 19), cross_line.endpoint) + truthy(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 -- cgit v1.2.3