summaryrefslogtreecommitdiff
path: root/tests/run.lua
diff options
context:
space:
mode:
Diffstat (limited to 'tests/run.lua')
-rw-r--r--tests/run.lua15
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/run.lua b/tests/run.lua
index b7a4820..7e47330 100644
--- a/tests/run.lua
+++ b/tests/run.lua
@@ -4580,6 +4580,21 @@ test("Direct preview scanning excludes the cursor and opposite side", function()
same(domain.Position.new(1, 1), backward[2].position)
end)
+test("Lower-case descriptors scan direct previews forward", function()
+ local view = text_topology.new({ "abcde" }, "utf-8")
+ local planner = direct_preview_planner.new()
+ local origin = domain.Position.new(1, 2)
+
+ for _, descriptor in ipairs({ "f", "t" }) do
+ local records = planner:scan_for_descriptor(view, origin, descriptor)
+ same(3, #records)
+ same("c", records[1].character)
+ same(domain.Position.new(1, 3), records[1].position)
+ same("e", records[3].character)
+ same(domain.Position.new(1, 5), records[3].position)
+ end
+end)
+
for _, item in ipairs(tests) do
local ok, failure = xpcall(item.body, debug.traceback)
if not ok then