summaryrefslogtreecommitdiff
path: root/tests/run.lua
diff options
context:
space:
mode:
authorJackson Moore <jacksonmoore@tuta.io>2026-09-04 11:41:11 +0200
committerJackson Moore <jacksonmoore@tuta.io>2026-09-04 11:41:11 +0200
commit6e687e90027f256040c7861f37e4982a0ad3e5f1 (patch)
tree36a5259c26869bfb2918f8ca0724bbd271976312 /tests/run.lua
parent05700ac654c285c1a503d54613b2bb06a6696ffa (diff)
Scan lowercase previews forward
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