diff options
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/run.lua | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/tests/run.lua b/tests/run.lua index 60d6b5b..1f9b9da 100644 --- a/tests/run.lua +++ b/tests/run.lua @@ -2569,6 +2569,55 @@ test("MotionPlanFactory limits exclusive policy to character and line Visual", f ) end) +test("FIND requires destinations on the strict motion side", function() + local view = text_topology.new({ "axa" }, "utf-8") + local engine = destination_engine.new() + local target_match = target_plan.build(target("a"), matching_policy()) + local forward = motion_plan.build(target_match, "f") + local backward = motion_plan.build(target_match, "F") + + same( + domain.Position.new(1, 3), + engine:calculate( + view, + domain.Position.new(1, 1), + forward, + 1, + true + ).endpoint + ) + same( + domain.Position.new(1, 1), + engine:calculate( + view, + domain.Position.new(1, 3), + backward, + 1, + true + ).endpoint + ) + same( + domain.SearchStatus.BOUNDARY_BEFORE_ANY, + engine:calculate( + view, + domain.Position.new(1, 3), + forward, + 1, + false + ).status + ) + same( + domain.SearchStatus.BOUNDARY_BEFORE_ANY, + engine:calculate( + view, + domain.Position.new(1, 1), + backward, + 1, + false + ).status + ) +end) + for _, item in ipairs(tests) do local ok, failure = xpcall(item.body, debug.traceback) if not ok then |
