summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/run.lua39
1 files changed, 35 insertions, 4 deletions
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