summaryrefslogtreecommitdiff
path: root/tests/run.lua
diff options
context:
space:
mode:
Diffstat (limited to 'tests/run.lua')
-rw-r--r--tests/run.lua17
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/run.lua b/tests/run.lua
index 718488b..458b521 100644
--- a/tests/run.lua
+++ b/tests/run.lua
@@ -4735,6 +4735,23 @@ test("Smart-case previews mark the exact and lowercase union", function()
same(domain.Position.new(1, 3), one_marker[1])
end)
+test("TILL direct previews retain target occurrence positions", function()
+ local planner = direct_preview_planner.new({ lowercase = string.lower })
+ local view = text_topology.new({ "xaxa" }, "utf-8")
+ local origin = domain.Position.new(1, 1)
+
+ local find_positions = planner:plan(view, origin, "f", 2)
+ local till_positions = planner:plan(view, origin, "t", 2)
+ same(1, #find_positions)
+ same(1, #till_positions)
+ same(domain.Position.new(1, 4), find_positions[1])
+ same(find_positions[1], till_positions[1])
+ same(
+ domain.Position.new(1, 4),
+ direct_preview_planner.marker_position("t", domain.Position.new(1, 4))
+ )
+end)
+
for _, item in ipairs(tests) do
local ok, failure = xpcall(item.body, debug.traceback)
if not ok then