diff options
author | Rom Grk <romgrk.cc@gmail.com> | 2016-05-31 05:46:32 -0400 |
---|---|---|
committer | Justin M. Keyes <justinkz@gmail.com> | 2016-06-18 12:25:11 -0400 |
commit | 86b138b25de6b0699329fab25df152bbf7ddab63 (patch) | |
tree | bdcb7e018452ee58886d9234b2221fe91d5c9272 /test/functional/terminal/highlight_spec.lua | |
parent | cbda7d85f867d3786d7f2cc7dd5e22c3575285a4 (diff) | |
download | rneovim-86b138b25de6b0699329fab25df152bbf7ddab63.tar.gz rneovim-86b138b25de6b0699329fab25df152bbf7ddab63.tar.bz2 rneovim-86b138b25de6b0699329fab25df152bbf7ddab63.zip |
synIDattr(): return RRGGBB value for [fg|bg|sp]# #4851
add tests for synIDattr() with [fg|bg|sp]#
add tests for synIDattr and various #RGB colors
synIDattr: test for ui_rgb_attached()
test: fix tests for synIDattr fg/bg/sp
Diffstat (limited to 'test/functional/terminal/highlight_spec.lua')
-rw-r--r-- | test/functional/terminal/highlight_spec.lua | 31 |
1 files changed, 28 insertions, 3 deletions
diff --git a/test/functional/terminal/highlight_spec.lua b/test/functional/terminal/highlight_spec.lua index 8876c68673..79b2bf0bc4 100644 --- a/test/functional/terminal/highlight_spec.lua +++ b/test/functional/terminal/highlight_spec.lua @@ -165,24 +165,49 @@ end) describe('synIDattr()', function() local screen - before_each(function() clear() screen = Screen.new(50, 7) - execute('highlight Normal ctermfg=1 guifg=#ff0000') + execute('highlight Normal ctermfg=1 guifg=#ff0000 guibg=Black') + -- Salmon #fa8072 Maroon #800000 + execute('highlight Keyword ctermfg=2 guifg=Salmon guisp=Maroon') end) after_each(function() screen:detach() end) - it('returns RGB number if GUI', function() + it('returns gui-color if GUI', function() + eq('1', eval('synIDattr(hlID("Normal"), "fg")')) + eq('-1', eval('synIDattr(hlID("Normal"), "bg")')) + + eq('2', eval('synIDattr(hlID("Keyword"), "fg")')) + eq('', eval('synIDattr(hlID("Keyword"), "sp")')) screen:attach(true) eq('#ff0000', eval('synIDattr(hlID("Normal"), "fg")')) + eq('Black', eval('synIDattr(hlID("Normal"), "bg")')) + + eq('Salmon', eval('synIDattr(hlID("Keyword"), "fg")')) + eq('Maroon', eval('synIDattr(hlID("Keyword"), "sp")')) + end) + + it('returns #RRGGBB value for [fg|bg|sp]#', function() + eq('1', eval('synIDattr(hlID("Normal"), "fg#")')) + eq('-1', eval('synIDattr(hlID("Normal"), "bg#")')) + + eq('2', eval('synIDattr(hlID("Keyword"), "fg#")')) + eq('', eval('synIDattr(hlID("Keyword"), "sp#")')) + screen:attach(true) + eq('#ff0000', eval('synIDattr(hlID("Normal"), "fg#")')) + eq('#000000', eval('synIDattr(hlID("Normal"), "bg#")')) + + eq('#fa8072', eval('synIDattr(hlID("Keyword"), "fg#")')) + eq('#800000', eval('synIDattr(hlID("Keyword"), "sp#")')) end) it('returns color number if non-GUI', function() screen:attach(false) eq('1', eval('synIDattr(hlID("Normal"), "fg")')) + eq('2', eval('synIDattr(hlID("Keyword"), "fg")')) end) end) |