diff options
| author | Jackson Moore <jacksonmoore@tuta.io> | 2026-09-04 11:44:24 +0200 |
|---|---|---|
| committer | Jackson Moore <jacksonmoore@tuta.io> | 2026-09-04 11:44:24 +0200 |
| commit | 5a51b5692e29ac4ab2ceda5888126745b99823d7 (patch) | |
| tree | 2fe9b165b07a3b6ba165a4dba8c84cdd9499411e /tests/run.lua | |
| parent | 573556d69a64d2b044996e1b7eac986027b9dfda (diff) | |
Mark smart-case preview union
Diffstat (limited to 'tests/run.lua')
| -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 |
