diff options
| author | Jackson Moore <jacksonmoore@tuta.io> | 2026-09-04 11:43:39 +0200 |
|---|---|---|
| committer | Jackson Moore <jacksonmoore@tuta.io> | 2026-09-04 11:43:39 +0200 |
| commit | 6e9e352375031126902ca062464dd4c4414a6e46 (patch) | |
| tree | f97ef9eecb1c5edf0a75eb873e575a6d04574a17 /tests/run.lua | |
| parent | ec1b1cccdae8ec536fdc99cc3b0f3fe0593c8ea4 (diff) | |
Count exact smart-case characters
Diffstat (limited to 'tests/run.lua')
| -rw-r--r-- | tests/run.lua | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/run.lua b/tests/run.lua index 3c2a077..ba6757f 100644 --- a/tests/run.lua +++ b/tests/run.lua @@ -4676,6 +4676,22 @@ test("Ignore-case previews count editor-folded character classes", function() same(0, #exact) end) +test("Smart-case previews increment every exact character counter", function() + local planner = direct_preview_planner.new({ lowercase = string.lower }) + local view = text_topology.new({ "xAAcc" }, "utf-8") + local positions = planner:plan( + view, + domain.Position.new(1, 1), + "f", + 2, + { ignore_case = false, smart_case = true } + ) + + same(2, #positions) + same(domain.Position.new(1, 3), positions[1]) + same(domain.Position.new(1, 5), positions[2]) +end) + for _, item in ipairs(tests) do local ok, failure = xpcall(item.body, debug.traceback) if not ok then |
