aboutsummaryrefslogtreecommitdiff
path: root/test/functional/api/highlight_spec.lua
diff options
context:
space:
mode:
authorbfredl <bjorn.linse@gmail.com>2022-06-22 10:49:36 +0200
committerGitHub <noreply@github.com>2022-06-22 10:49:36 +0200
commitdd591adf8a1d145b2fdf9115509bcc80c9ee7943 (patch)
tree081bb7e699cf9e85c7dd04727372f2c217ced9ca /test/functional/api/highlight_spec.lua
parentf17d88c47a6a647f2230a61e7cd952926abc4473 (diff)
parent8cd94e3bc06f43e73c5567b7db5cb37c164e28b8 (diff)
downloadrneovim-dd591adf8a1d145b2fdf9115509bcc80c9ee7943.tar.gz
rneovim-dd591adf8a1d145b2fdf9115509bcc80c9ee7943.tar.bz2
rneovim-dd591adf8a1d145b2fdf9115509bcc80c9ee7943.zip
Merge pull request #19039 from bfredl/multicolor
perf: get rid of unnecessary allocations in highlight groups
Diffstat (limited to 'test/functional/api/highlight_spec.lua')
-rw-r--r--test/functional/api/highlight_spec.lua13
1 files changed, 7 insertions, 6 deletions
diff --git a/test/functional/api/highlight_spec.lua b/test/functional/api/highlight_spec.lua
index 8235374f22..c57c1b12dc 100644
--- a/test/functional/api/highlight_spec.lua
+++ b/test/functional/api/highlight_spec.lua
@@ -293,19 +293,20 @@ describe("API: set highlight", function()
eq('Test_hl2 xxx cterm=undercurl,italic,reverse,strikethrough ctermfg=8 ctermbg=15 gui=bold,underline,underlineline,undercurl,underdot,underdash,italic,reverse,strikethrough guifg=#ff0000 guibg=#0032aa',
exec_capture('highlight Test_hl2'))
- -- Colors are stored exactly as they are defined.
+ -- Colors are stored with the name they are defined, but
+ -- with canonical casing
meths.set_hl(0, 'Test_hl3', { bg = 'reD', fg = 'bLue'})
- eq('Test_hl3 xxx guifg=bLue guibg=reD',
+ eq('Test_hl3 xxx guifg=Blue guibg=Red',
exec_capture('highlight Test_hl3'))
end)
it ("can modify a highlight in the global namespace", function()
meths.set_hl(0, 'Test_hl3', { bg = 'red', fg = 'blue'})
- eq('Test_hl3 xxx guifg=blue guibg=red',
+ eq('Test_hl3 xxx guifg=Blue guibg=Red',
exec_capture('highlight Test_hl3'))
meths.set_hl(0, 'Test_hl3', { bg = 'red' })
- eq('Test_hl3 xxx guibg=red',
+ eq('Test_hl3 xxx guibg=Red',
exec_capture('highlight Test_hl3'))
meths.set_hl(0, 'Test_hl3', { ctermbg = 9, ctermfg = 12})
@@ -327,7 +328,7 @@ describe("API: set highlight", function()
pcall_err(meths.set_hl, 0, 'Test_hl3', {ctermfg='bleu'}))
meths.set_hl(0, 'Test_hl3', {fg='#FF00FF'})
- eq('Test_hl3 xxx guifg=#FF00FF',
+ eq('Test_hl3 xxx guifg=#ff00ff',
exec_capture('highlight Test_hl3'))
eq("'#FF00FF' is not a valid color",
@@ -340,7 +341,7 @@ describe("API: set highlight", function()
end
meths.set_hl(0, 'Test_hl3', {fg='#FF00FF', blend=50})
- eq('Test_hl3 xxx guifg=#FF00FF blend=50',
+ eq('Test_hl3 xxx guifg=#ff00ff blend=50',
exec_capture('highlight Test_hl3'))
end)