diff options
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/run.lua | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/tests/run.lua b/tests/run.lua index 4984fb6..718488b 100644 --- a/tests/run.lua +++ b/tests/run.lua @@ -4710,6 +4710,31 @@ test("Smart-case previews add ASCII uppercase to lowercase counters", function() falsy(direct_preview_planner.is_upper_ascii("AA")) end) +test("Smart-case previews mark the exact and lowercase union", function() + local planner = direct_preview_planner.new({ lowercase = string.lower }) + local origin = domain.Position.new(1, 1) + + local folded_position = planner:plan( + text_topology.new({ "xaA" }, "utf-8"), + origin, + "f", + 2, + { ignore_case = false, smart_case = true } + ) + same(1, #folded_position) + same(domain.Position.new(1, 3), folded_position[1]) + + local one_marker = planner:plan( + text_topology.new({ "xAA" }, "utf-8"), + origin, + "f", + 2, + { ignore_case = false, smart_case = true } + ) + same(1, #one_marker) + same(domain.Position.new(1, 3), one_marker[1]) +end) + for _, item in ipairs(tests) do local ok, failure = xpcall(item.body, debug.traceback) if not ok then |
