diff options
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/run.lua | 30 |
1 files changed, 30 insertions, 0 deletions
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 |
