From 9ff556e67af425c9bdf187f214bd9323b22f2413 Mon Sep 17 00:00:00 2001 From: Jackson Moore Date: Fri, 4 Sep 2026 11:36:29 +0200 Subject: Preserve colorscheme feature groups --- tests/run.lua | 39 +++++++++++++++++++++++++++++++++++---- 1 file changed, 35 insertions(+), 4 deletions(-) (limited to 'tests/run.lua') diff --git a/tests/run.lua b/tests/run.lua index 7a245f9..e1c7e78 100644 --- a/tests/run.lua +++ b/tests/run.lua @@ -4297,13 +4297,44 @@ test("Explicit color configuration forces its feature link", function() same("Search", results.CleverFCursor.target) same("Search", host:highlight_groups().CleverFCursor.link) - local operations = host:operations() - local definition = operations[#operations] - same("define_highlight_group", definition.operation) - same("CleverFCursor", definition.name) + local definition + for _, operation in ipairs(host:operations()) do + if operation.operation == "define_highlight_group" + and operation.name == "CleverFCursor" + then + definition = operation + end + end + truthy(definition ~= nil) truthy(definition.options.force) end) +test("Feature link evaluation preserves colorscheme CleverF groups", function() + local custom = { + guifg = "magenta", + gui = { reverse = true }, + } + local host = MemoryHost.new({ + highlight_groups = { + CleverFChar = custom, + }, + }) + local feedback = feedback_service.new(host) + + local results = feedback:evaluate_feature_links() + same("colorscheme", results.CleverFChar.source) + falsy(results.CleverFChar.applied) + same("magenta", results.CleverFChar.definition.guifg) + truthy(results.CleverFChar.definition.gui.reverse) + same("magenta", host:highlight_groups().CleverFChar.guifg) + + for _, operation in ipairs(host:operations()) do + if operation.operation == "define_highlight_group" then + falsy(operation.name == "CleverFChar") + end + end +end) + for _, item in ipairs(tests) do local ok, failure = xpcall(item.body, debug.traceback) if not ok then -- cgit v1.2.3