aboutsummaryrefslogtreecommitdiff
path: root/test/functional/api/highlight_spec.lua
diff options
context:
space:
mode:
authorLewis Russell <lewis6991@gmail.com>2022-02-16 20:38:40 +0000
committerLewis Russell <lewis6991@gmail.com>2022-02-16 22:48:34 +0000
commitdc24eeb9febaa331e660e14c3c325fd0977b6b93 (patch)
treebf6bea481594965dac41476eb27ca5360c9b8092 /test/functional/api/highlight_spec.lua
parent876aaf2003d1a6eb8f0701cf11e1834751b28980 (diff)
downloadrneovim-dc24eeb9febaa331e660e14c3c325fd0977b6b93.tar.gz
rneovim-dc24eeb9febaa331e660e14c3c325fd0977b6b93.tar.bz2
rneovim-dc24eeb9febaa331e660e14c3c325fd0977b6b93.zip
feat(highlight): support color names for cterm
Diffstat (limited to 'test/functional/api/highlight_spec.lua')
-rw-r--r--test/functional/api/highlight_spec.lua17
1 files changed, 17 insertions, 0 deletions
diff --git a/test/functional/api/highlight_spec.lua b/test/functional/api/highlight_spec.lua
index a412a236a7..416945f379 100644
--- a/test/functional/api/highlight_spec.lua
+++ b/test/functional/api/highlight_spec.lua
@@ -290,6 +290,10 @@ describe("API: set highlight", function()
eq('Test_hl3 xxx ctermfg=12 ctermbg=9',
exec_capture('highlight Test_hl3'))
+ meths.set_hl(0, 'Test_hl3', { ctermbg = 'red' , ctermfg = 'blue'})
+ eq('Test_hl3 xxx ctermfg=12 ctermbg=9',
+ exec_capture('highlight Test_hl3'))
+
meths.set_hl(0, 'Test_hl3', { ctermbg = 9 })
eq('Test_hl3 xxx ctermbg=9',
exec_capture('highlight Test_hl3'))
@@ -297,5 +301,18 @@ describe("API: set highlight", function()
meths.set_hl(0, 'Test_hl3', {})
eq('Test_hl3 xxx cleared',
exec_capture('highlight Test_hl3'))
+
+ eq("'redd' is not a valid color",
+ pcall_err(meths.set_hl, 0, 'Test_hl3', {fg='redd'}))
+
+ eq("'bleu' is not a valid color",
+ pcall_err(meths.set_hl, 0, 'Test_hl3', {ctermfg='bleu'}))
+
+ meths.set_hl(0, 'Test_hl3', {fg='#FF00FF'})
+ eq('Test_hl3 xxx guifg=#FF00FF',
+ exec_capture('highlight Test_hl3'))
+
+ eq("'#FF00FF' is not a valid color",
+ pcall_err(meths.set_hl, 0, 'Test_hl3', {ctermfg='#FF00FF'}))
end)
end)