diff options
| author | Jackson Moore <jacksonmoore@tuta.io> | 2026-09-04 11:43:10 +0200 |
|---|---|---|
| committer | Jackson Moore <jacksonmoore@tuta.io> | 2026-09-04 11:43:10 +0200 |
| commit | ec1b1cccdae8ec536fdc99cc3b0f3fe0593c8ea4 (patch) | |
| tree | f9d0a7705d881e65cc750fa28b58c917c07954cf /tests/run.lua | |
| parent | 01caae6671f456d898f20d1ea29c3315c93f01f2 (diff) | |
Count folded preview classes
Diffstat (limited to 'tests/run.lua')
| -rw-r--r-- | tests/run.lua | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/tests/run.lua b/tests/run.lua index 7ec0baf..3c2a077 100644 --- a/tests/run.lua +++ b/tests/run.lua @@ -4649,6 +4649,33 @@ test("Default direct previews count each exact character", function() list_same({ 15 }, columns(planner:plan(view, origin, "f", 3))) end) +test("Ignore-case previews count editor-folded character classes", function() + local folded = {} + local planner = direct_preview_planner.new({ + lowercase = function(character) + folded[#folded + 1] = character + return string.lower(character) + end, + }) + local view = text_topology.new({ "xAaBbC" }, "utf-8") + local origin = domain.Position.new(1, 1) + + local positions = planner:plan(view, origin, "f", 2, { + ignore_case = true, + smart_case = false, + }) + same(2, #positions) + same(domain.Position.new(1, 3), positions[1]) + same(domain.Position.new(1, 5), positions[2]) + list_same({ "A", "a", "B", "b", "C" }, folded) + + local exact = planner:plan(view, origin, "f", 2, { + ignore_case = false, + smart_case = false, + }) + same(0, #exact) +end) + for _, item in ipairs(tests) do local ok, failure = xpcall(item.body, debug.traceback) if not ok then |
