diff options
Diffstat (limited to 'tests/run.lua')
| -rw-r--r-- | tests/run.lua | 36 |
1 files changed, 36 insertions, 0 deletions
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 |
