aboutsummaryrefslogtreecommitdiff
path: root/test/functional/ex_cmds/highlight_spec.lua
diff options
context:
space:
mode:
authorZyX <kp-pav@yandex.ru>2017-11-26 15:54:03 +0300
committerZyX <kp-pav@yandex.ru>2017-11-26 15:54:03 +0300
commitb9c78130587e42ca3b6417b47fb739a166da8eb7 (patch)
tree142cf7dd0a87dfb32a20838e7683dd1980e4b3e7 /test/functional/ex_cmds/highlight_spec.lua
parent05a3c12118a6dae0ac8f3603f9ee4d9fd9450cce (diff)
parent207b7ca4bc16d52641eaa5244eef25a0dba91dbc (diff)
downloadrneovim-b9c78130587e42ca3b6417b47fb739a166da8eb7.tar.gz
rneovim-b9c78130587e42ca3b6417b47fb739a166da8eb7.tar.bz2
rneovim-b9c78130587e42ca3b6417b47fb739a166da8eb7.zip
Merge branch 'master' into expression-parser
Diffstat (limited to 'test/functional/ex_cmds/highlight_spec.lua')
-rw-r--r--test/functional/ex_cmds/highlight_spec.lua43
1 files changed, 43 insertions, 0 deletions
diff --git a/test/functional/ex_cmds/highlight_spec.lua b/test/functional/ex_cmds/highlight_spec.lua
new file mode 100644
index 0000000000..25968b8204
--- /dev/null
+++ b/test/functional/ex_cmds/highlight_spec.lua
@@ -0,0 +1,43 @@
+local Screen = require('test.functional.ui.screen')
+local helpers = require("test.functional.helpers")(after_each)
+local eq, command = helpers.eq, helpers.command
+local clear = helpers.clear
+local eval, exc_exec = helpers.eval, helpers.exc_exec
+
+describe(':highlight', function()
+ local screen
+
+ before_each(function()
+ clear()
+ screen = Screen.new()
+ screen:attach()
+ end)
+
+ after_each(function()
+ screen:detach()
+ end)
+
+ it('invalid color name', function()
+ eq('Vim(highlight):E421: Color name or number not recognized: ctermfg=#181818',
+ exc_exec("highlight normal ctermfg=#181818"))
+ eq('Vim(highlight):E421: Color name or number not recognized: ctermbg=#181818',
+ exc_exec("highlight normal ctermbg=#181818"))
+ end)
+
+ it('invalid group name', function()
+ eq('Vim(highlight):E411: highlight group not found: foo',
+ exc_exec("highlight foo"))
+ end)
+
+ it('"Normal" foreground with red', function()
+ eq('', eval('synIDattr(hlID("Normal"), "fg", "cterm")'))
+ command('highlight normal ctermfg=red')
+ eq('9', eval('synIDattr(hlID("Normal"), "fg", "cterm")'))
+ end)
+
+ it('"Normal" background with red', function()
+ eq('', eval('synIDattr(hlID("Normal"), "bg", "cterm")'))
+ command('highlight normal ctermbg=red')
+ eq('9', eval('synIDattr(hlID("Normal"), "bg", "cterm")'))
+ end)
+end)