diff options
author | Marco Hinz <mh.codebro@gmail.com> | 2015-07-14 17:40:33 +0200 |
---|---|---|
committer | Marco Hinz <mh.codebro@gmail.com> | 2015-07-18 16:55:25 +0200 |
commit | 9d876eb0374cf87455d56ffd62c1c8e90c423876 (patch) | |
tree | 548dc9ed5f9afc2048f4911d902ea5fcd1442152 /test/functional/terminal/highlight_spec.lua | |
parent | 84ce97714b4f614da0851b74e9774d5b50e881a2 (diff) | |
download | rneovim-9d876eb0374cf87455d56ffd62c1c8e90c423876.tar.gz rneovim-9d876eb0374cf87455d56ffd62c1c8e90c423876.tar.bz2 rneovim-9d876eb0374cf87455d56ffd62c1c8e90c423876.zip |
Test: synIDattr(): true color awareness
Diffstat (limited to 'test/functional/terminal/highlight_spec.lua')
-rw-r--r-- | test/functional/terminal/highlight_spec.lua | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/test/functional/terminal/highlight_spec.lua b/test/functional/terminal/highlight_spec.lua index b72527e7b6..1a96cb4dba 100644 --- a/test/functional/terminal/highlight_spec.lua +++ b/test/functional/terminal/highlight_spec.lua @@ -3,6 +3,7 @@ local Screen = require('test.functional.ui.screen') local thelpers = require('test.functional.terminal.helpers') local feed, clear, nvim = helpers.feed, helpers.clear, helpers.nvim local nvim_dir, execute = helpers.nvim_dir, helpers.execute +local eq, eval = helpers.eq, helpers.eval describe('terminal window highlighting', function() @@ -161,3 +162,27 @@ describe('terminal window highlighting with custom palette', function() ]]) end) end) + +describe('synIDattr()', function() + local screen + + before_each(function() + clear() + screen = Screen.new(50, 7) + execute('highlight Normal ctermfg=1 guifg=#ff0000') + end) + + after_each(function() + screen:detach() + end) + + it('returns RGB number if GUI', function() + screen:attach(true) + eq('#ff0000', eval('synIDattr(hlID("Normal"), "fg")')) + end) + + it('returns color number if non-GUI', function() + screen:attach(false) + eq('1', eval('synIDattr(hlID("Normal"), "fg")')) + end) +end) |