From 881a6714c6bfd4d28c5b0470ad54041e5399a06c Mon Sep 17 00:00:00 2001 From: Jackson Moore Date: Fri, 4 Sep 2026 11:45:19 +0200 Subject: Isolate direct preview case grouping --- tests/run.lua | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) (limited to 'tests/run.lua') diff --git a/tests/run.lua b/tests/run.lua index 458b521..3c5150a 100644 --- a/tests/run.lua +++ b/tests/run.lua @@ -4752,6 +4752,36 @@ test("TILL direct previews retain target occurrence positions", function() ) end) +test("Direct preview counters ignore Migemo and symbol merging", function() + local planner = direct_preview_planner.new({ lowercase = string.lower }) + local positions = planner:plan( + text_topology.new({ "x;!;!" }, "utf-8"), + domain.Position.new(1, 1), + "f", + 2, + { + ignore_case = false, + smart_case = false, + use_migemo = true, + chars_match_any_signs = ";", + } + ) + + same(2, #positions) + same(domain.Position.new(1, 4), positions[1]) + same(domain.Position.new(1, 5), positions[2]) + local grouping = direct_preview_planner.case_grouping_settings({ + ignore_case = true, + smart_case = true, + use_migemo = true, + chars_match_any_signs = ";", + }) + truthy(grouping.ignore_case) + truthy(grouping.smart_case) + same(nil, grouping.use_migemo) + same(nil, grouping.chars_match_any_signs) +end) + for _, item in ipairs(tests) do local ok, failure = xpcall(item.body, debug.traceback) if not ok then -- cgit v1.2.3