aboutsummaryrefslogtreecommitdiff
path: root/test/functional/api
diff options
context:
space:
mode:
authorglepnir <glephunter@gmail.com>2023-09-16 19:08:40 +0800
committerglepnir <glephunter@gmail.com>2023-09-17 17:47:51 +0800
commit51836517738babaa406bc615fd9984129c5179a4 (patch)
treea3b70d7b9550696c6eeb38c2bb7cd1a184e2b395 /test/functional/api
parenta6e74c1f0a2bbf03f5b99c167b549018f4c8fb0d (diff)
downloadrneovim-51836517738babaa406bc615fd9984129c5179a4.tar.gz
rneovim-51836517738babaa406bc615fd9984129c5179a4.tar.bz2
rneovim-51836517738babaa406bc615fd9984129c5179a4.zip
fix(highlight): correct hi command output
Diffstat (limited to 'test/functional/api')
-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 492fd73223..5d6aaa57e6 100644
--- a/test/functional/api/highlight_spec.lua
+++ b/test/functional/api/highlight_spec.lua
@@ -608,4 +608,21 @@ describe('API: get highlight', function()
meths.set_hl(0, 'Tried', { fg = "#00ff00", default = true })
eq({ fg = tonumber('00ff00', 16), default = true }, meths.get_hl(0, { name = 'Tried' }))
end)
+
+ it('should not output empty gui and cterm #23474', function()
+ meths.set_hl(0, 'Foo', {default = true})
+ meths.set_hl(0, 'Bar', { default = true, fg = '#ffffff' })
+ meths.set_hl(0, 'FooBar', { default = true, fg = '#ffffff', cterm = {bold = true} })
+ meths.set_hl(0, 'FooBarA', { default = true, fg = '#ffffff', cterm = {bold = true,italic = true}})
+
+ eq('Foo xxx cleared',
+ exec_capture('highlight Foo'))
+ eq({default = true}, meths.get_hl(0, {name = 'Foo'}))
+ eq('Bar xxx guifg=#ffffff',
+ exec_capture('highlight Bar'))
+ eq('FooBar xxx cterm=bold guifg=#ffffff',
+ exec_capture('highlight FooBar'))
+ eq('FooBarA xxx cterm=bold,italic guifg=#ffffff',
+ exec_capture('highlight FooBarA'))
+ end)
end)