From 70bc720156f8ff315fcf54f478becfdf098f3994 Mon Sep 17 00:00:00 2001 From: Jackson Moore Date: Fri, 4 Sep 2026 12:41:06 +0200 Subject: Detect cross-line feedback migration --- tests/run.lua | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'tests') diff --git a/tests/run.lua b/tests/run.lua index b0f9cee..e73dda7 100644 --- a/tests/run.lua +++ b/tests/run.lua @@ -6374,6 +6374,31 @@ test("Full feedback finalization preserves reusable sequence data", function() same(dictionary, state:get_migemo("utf-8")) end) +test("Command feedback migration compares origin and destination lines", function() + same( + nil, + feedback_service.command_migration_reason({ + origin = domain.Position.new(2, 1), + destination = domain.Position.new(2, 7), + }) + ) + same( + feedback_service.MigrationReason.LINE_CHANGE, + feedback_service.command_migration_reason({ + origin = domain.Position.new(2, 7), + destination = domain.Position.new(3, 1), + }) + ) + same( + nil, + feedback_service.command_migration_reason({ + origin = domain.Position.new(2, 7), + destination = domain.Position.new(3, 1), + outcome = { complete = false }, + }) + ) +end) + for _, item in ipairs(tests) do local ok, failure = xpcall(item.body, debug.traceback) if not ok then -- cgit v1.2.3