diff options
| author | Jackson Moore <jacksonmoore@tuta.io> | 2026-09-04 11:44:04 +0200 |
|---|---|---|
| committer | Jackson Moore <jacksonmoore@tuta.io> | 2026-09-04 11:44:04 +0200 |
| commit | 573556d69a64d2b044996e1b7eac986027b9dfda (patch) | |
| tree | 66eb63a0ac8de14fb6350e7409cef94c22ef95ff /tests | |
| parent | 6e9e352375031126902ca062464dd4c4414a6e46 (diff) | |
Count uppercase smart-case folds
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/run.lua | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/run.lua b/tests/run.lua index ba6757f..4984fb6 100644 --- a/tests/run.lua +++ b/tests/run.lua @@ -4692,6 +4692,24 @@ test("Smart-case previews increment every exact character counter", function() same(domain.Position.new(1, 5), positions[2]) end) +test("Smart-case previews add ASCII uppercase to lowercase counters", function() + local planner = direct_preview_planner.new({ lowercase = string.lower }) + local view = text_topology.new({ "xAa" }, "utf-8") + local positions = planner:plan( + view, + domain.Position.new(1, 1), + "f", + 2, + { ignore_case = false, smart_case = true } + ) + + same(1, #positions) + same(domain.Position.new(1, 3), positions[1]) + truthy(direct_preview_planner.is_upper_ascii("A")) + falsy(direct_preview_planner.is_upper_ascii("a")) + falsy(direct_preview_planner.is_upper_ascii("AA")) +end) + for _, item in ipairs(tests) do local ok, failure = xpcall(item.body, debug.traceback) if not ok then |
