aboutsummaryrefslogtreecommitdiff
path: root/test/functional/api/highlight_spec.lua
diff options
context:
space:
mode:
authorshadmansaleh <shadmansaleh3@gmail.com>2021-04-03 10:18:40 +0600
committershadmansaleh <shadmansaleh3@gmail.com>2021-04-03 10:18:40 +0600
commitf4224a12c039f09e237ac7e5e7db4431747a9b54 (patch)
tree1125ecfa39ee6f7e26712e51144afecf31c4c2d9 /test/functional/api/highlight_spec.lua
parent7a6228d581d4ba49ac26b316362278e180791959 (diff)
downloadrneovim-f4224a12c039f09e237ac7e5e7db4431747a9b54.tar.gz
rneovim-f4224a12c039f09e237ac7e5e7db4431747a9b54.tar.bz2
rneovim-f4224a12c039f09e237ac7e5e7db4431747a9b54.zip
Fix lualint warnings
Diffstat (limited to 'test/functional/api/highlight_spec.lua')
-rw-r--r--test/functional/api/highlight_spec.lua16
1 files changed, 9 insertions, 7 deletions
diff --git a/test/functional/api/highlight_spec.lua b/test/functional/api/highlight_spec.lua
index 04ed22efba..6f9188d880 100644
--- a/test/functional/api/highlight_spec.lua
+++ b/test/functional/api/highlight_spec.lua
@@ -217,34 +217,36 @@ describe("API: set highlight", function()
undercurl = true,
}
- before_each(function()
- _G.ns = meths.get_namespaces().Test_set_hl
+ local function get_ns()
+ local ns = meths.get_namespaces().Test_set_hl
if not ns then ns = meths.create_namespace('Test_set_hl') end
meths._set_hl_ns(ns)
- end)
-
- after_each(function()
- _G.ns = nil
- end)
+ return ns
+ end
it ("can set gui highlight", function()
+ local ns = get_ns()
meths.set_hl(ns, 'Test_hl', highlight1)
eq(highlight1, meths.get_hl_by_name('Test_hl', true))
end)
it ("can set cterm highlight", function()
+ local ns = get_ns()
meths.set_hl(ns, 'Test_hl', highlight2_config)
eq(highlight2_result, meths.get_hl_by_name('Test_hl', false))
end)
it ("cterm attr defaults to gui attr", function()
+ local ns = get_ns()
meths.set_hl(ns, 'Test_hl', highlight1)
eq({
bold = true,
italic = true,
}, meths.get_hl_by_name('Test_hl', false))
end)
+
it ("can overwrite attr for cterm", function()
+ local ns = get_ns()
meths.set_hl(ns, 'Test_hl', highlight3_config)
eq(highlight3_result_gui, meths.get_hl_by_name('Test_hl', true))
eq(highlight3_result_cterm, meths.get_hl_by_name('Test_hl', false))