summaryrefslogtreecommitdiff
path: root/tests/run.lua
diff options
context:
space:
mode:
Diffstat (limited to 'tests/run.lua')
-rw-r--r--tests/run.lua16
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/run.lua b/tests/run.lua
index 3c2a077..ba6757f 100644
--- a/tests/run.lua
+++ b/tests/run.lua
@@ -4676,6 +4676,22 @@ test("Ignore-case previews count editor-folded character classes", function()
same(0, #exact)
end)
+test("Smart-case previews increment every exact character counter", function()
+ local planner = direct_preview_planner.new({ lowercase = string.lower })
+ local view = text_topology.new({ "xAAcc" }, "utf-8")
+ local positions = planner:plan(
+ view,
+ domain.Position.new(1, 1),
+ "f",
+ 2,
+ { ignore_case = false, smart_case = true }
+ )
+
+ same(2, #positions)
+ same(domain.Position.new(1, 3), positions[1])
+ same(domain.Position.new(1, 5), positions[2])
+end)
+
for _, item in ipairs(tests) do
local ok, failure = xpcall(item.body, debug.traceback)
if not ok then