diff options
| author | Jackson Moore <jacksonmoore@tuta.io> | 2026-09-04 11:40:26 +0200 |
|---|---|---|
| committer | Jackson Moore <jacksonmoore@tuta.io> | 2026-09-04 11:40:26 +0200 |
| commit | 5574e26f6bf1152a50e28080ca200e447f1acade (patch) | |
| tree | 495e2217af17648cc7d7d554e8d424d896c488b9 /tests/run.lua | |
| parent | 07cb5088325b7272f8718bfaee9e85515ae6a81e (diff) | |
Scan direct previews on current line
Diffstat (limited to 'tests/run.lua')
| -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 7ca4e3c..e16f082 100644 --- a/tests/run.lua +++ b/tests/run.lua @@ -9,6 +9,7 @@ package.path = table.concat({ local domain = require("clever_f.domain") local capabilities = require("clever_f.capabilities") local destination_engine = require("clever_f.destination_engine") +local direct_preview_planner = require("clever_f.direct_preview_planner") local feedback_service = require("clever_f.feedback_service") local case_policy = require("clever_f.case_policy") local policy = require("clever_f.policy") @@ -4540,6 +4541,23 @@ test("Cursor suppression requires policy and runtime support", function() same(1, operation_count(enabled, "suppress_cursor_presentation")) end) +test("Direct preview scanning stays on the cursor line", function() + local view = text_topology.new({ "abc", "de", "fgh" }, "utf-8") + local planner = direct_preview_planner.new() + truthy(direct_preview_planner.DirectPreviewPlanner.is(planner)) + + local records = planner:scan_current_line( + view, + domain.Position.new(2, 2), + domain.Direction.FORWARD + ) + same(2, #records) + same(domain.Position.new(2, 1), records[1].position) + same("d", records[1].character) + same(domain.Position.new(2, 2), records[2].position) + same("e", records[2].character) +end) + for _, item in ipairs(tests) do local ok, failure = xpcall(item.body, debug.traceback) if not ok then |
