From 6e9e352375031126902ca062464dd4c4414a6e46 Mon Sep 17 00:00:00 2001 From: Jackson Moore Date: Fri, 4 Sep 2026 11:43:39 +0200 Subject: Count exact smart-case characters --- tests/run.lua | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'tests/run.lua') 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 -- cgit v1.2.3