aboutsummaryrefslogtreecommitdiff
path: root/test/functional/ex_cmds
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
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')
-rw-r--r--test/functional/ex_cmds/highlight_spec.lua43
-rw-r--r--test/functional/ex_cmds/quickfix_commands_spec.lua28
2 files changed, 71 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)
diff --git a/test/functional/ex_cmds/quickfix_commands_spec.lua b/test/functional/ex_cmds/quickfix_commands_spec.lua
index 5ab34db3fb..bf10f80401 100644
--- a/test/functional/ex_cmds/quickfix_commands_spec.lua
+++ b/test/functional/ex_cmds/quickfix_commands_spec.lua
@@ -7,6 +7,7 @@ local command = helpers.command
local exc_exec = helpers.exc_exec
local write_file = helpers.write_file
local curbufmeths = helpers.curbufmeths
+local source = helpers.source
local file_base = 'Xtest-functional-ex_cmds-quickfix_commands'
@@ -81,3 +82,30 @@ for _, c in ipairs({'l', 'c'}) do
end)
end)
end
+
+describe('quickfix', function()
+ it('location-list update on buffer modification', function()
+ source([[
+ new
+ setl bt=nofile
+ let lines = ['Line 1', 'Line 2', 'Line 3', 'Line 4', 'Line 5']
+ call append(0, lines)
+ new
+ setl bt=nofile
+ call append(0, lines)
+ let qf_item = {
+ \ 'lnum': 4,
+ \ 'text': "This is the error line.",
+ \ }
+ let qf_item['bufnr'] = bufnr('%')
+ call setloclist(0, [qf_item])
+ wincmd p
+ let qf_item['bufnr'] = bufnr('%')
+ call setloclist(0, [qf_item])
+ 1del _
+ call append(0, ['New line 1', 'New line 2', 'New line 3'])
+ silent ll
+ ]])
+ eq({0, 6, 1, 0, 1}, funcs.getcurpos())
+ end)
+end)