diff options
| author | Jackson Moore <jacksonmoore@tuta.io> | 2026-09-04 11:37:38 +0200 |
|---|---|---|
| committer | Jackson Moore <jacksonmoore@tuta.io> | 2026-09-04 11:37:38 +0200 |
| commit | 846277adf74fe59367b4c76280ed76fce10d1528 (patch) | |
| tree | 906a2f13a44e5cee9c5b5efeaed56c445b583175 /tests | |
| parent | e8c73c0c45d439abd06f3b7bdf29e7f6962ae665 (diff) | |
Gate feature link evaluation
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/run.lua | 34 |
1 files changed, 33 insertions, 1 deletions
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 |
