From 846277adf74fe59367b4c76280ed76fce10d1528 Mon Sep 17 00:00:00 2001 From: Jackson Moore Date: Fri, 4 Sep 2026 11:37:38 +0200 Subject: Gate feature link evaluation --- tests/run.lua | 34 +++++++++++++++++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-) (limited to 'tests') diff --git a/tests/run.lua b/tests/run.lua index ba5acd1..77551e1 100644 --- a/tests/run.lua +++ b/tests/run.lua @@ -4368,7 +4368,9 @@ test("Cursor feedback falls back to the Cursor group", function() end) test("Character and direct feedback fall back to the default label", function() - local host = MemoryHost.new() + local host = MemoryHost.new({ + configuration = { mark_direct = true }, + }) local feedback = feedback_service.new(host) local results = feedback:evaluate_feature_links() @@ -4379,6 +4381,36 @@ test("Character and direct feedback fall back to the default label", function() end end) +test("Feature links are evaluated only while their features are enabled", function() + local host = MemoryHost.new({ + configuration = { + mark_cursor = false, + mark_cursor_color = "Search", + mark_char = false, + mark_char_color = "IncSearch", + mark_direct = false, + mark_direct_color = "ErrorMsg", + }, + highlight_groups = { + CleverFCursor = { guifg = "one" }, + CleverFChar = { guifg = "two" }, + CleverFDirect = { guifg = "three" }, + }, + }) + local feedback = feedback_service.new(host) + + local results = feedback:evaluate_feature_links() + same(0, map_size(results)) + local groups = host:highlight_groups() + same("one", groups.CleverFCursor.guifg) + same("two", groups.CleverFChar.guifg) + same("three", groups.CleverFDirect.guifg) + for _, operation in ipairs(host:operations()) do + falsy(operation.operation == "define_highlight_group") + falsy(operation.operation == "read_highlight_group") + end +end) + for _, item in ipairs(tests) do local ok, failure = xpcall(item.body, debug.traceback) if not ok then -- cgit v1.2.3