aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/functional/api/keymap_spec.lua4
-rw-r--r--test/functional/api/vim_spec.lua4
-rw-r--r--test/functional/autocmd/tabclose_spec.lua18
-rw-r--r--test/functional/autocmd/tabnewentered_spec.lua8
-rw-r--r--test/functional/ex_cmds/script_spec.lua4
-rw-r--r--test/functional/ex_cmds/sign_spec.lua4
-rw-r--r--test/functional/options/keymap_spec.lua2
-rw-r--r--test/functional/terminal/buffer_spec.lua2
-rw-r--r--test/functional/ui/cmdline_highlight_spec.lua8
-rw-r--r--test/functional/ui/messages_spec.lua4
10 files changed, 29 insertions, 29 deletions
diff --git a/test/functional/api/keymap_spec.lua b/test/functional/api/keymap_spec.lua
index 773207d360..210394c83f 100644
--- a/test/functional/api/keymap_spec.lua
+++ b/test/functional/api/keymap_spec.lua
@@ -585,13 +585,13 @@ describe('nvim_set_keymap, nvim_del_keymap', function()
end)
it('can set <expr> mappings whose RHS change dynamically', function()
- meths.command_output([[
+ meths.exec([[
function! FlipFlop() abort
if !exists('g:flip') | let g:flip = 0 | endif
let g:flip = !g:flip
return g:flip
endfunction
- ]])
+ ]], true)
eq(1, meths.call_function('FlipFlop', {}))
eq(0, meths.call_function('FlipFlop', {}))
eq(1, meths.call_function('FlipFlop', {}))
diff --git a/test/functional/api/vim_spec.lua b/test/functional/api/vim_spec.lua
index d7baf68a5b..4f3279c80e 100644
--- a/test/functional/api/vim_spec.lua
+++ b/test/functional/api/vim_spec.lua
@@ -84,7 +84,7 @@ describe('API', function()
it(':verbose set {option}?', function()
nvim('exec', 'set nowrap', false)
- eq('nowrap\n\tLast set from :source (no file)',
+ eq('nowrap\n\tLast set from anonymous :source',
nvim('exec', 'verbose set wrap?', true))
end)
@@ -1800,7 +1800,7 @@ describe('API', function()
eq(' 1 %a "[No Name]" line 1\n'..
' 3 h "[Scratch]" line 0\n'..
' 4 h "[Scratch]" line 0',
- meths.command_output("ls"))
+ meths.exec('ls', true))
-- current buffer didn't change
eq({id=1}, meths.get_current_buf())
diff --git a/test/functional/autocmd/tabclose_spec.lua b/test/functional/autocmd/tabclose_spec.lua
index b7c33dc3d8..92d860c628 100644
--- a/test/functional/autocmd/tabclose_spec.lua
+++ b/test/functional/autocmd/tabclose_spec.lua
@@ -11,10 +11,10 @@ describe('TabClosed', function()
repeat
nvim('command', 'tabnew')
until nvim('eval', 'tabpagenr()') == 6 -- current tab is now 6
- eq("tabclosed:6:6:5", nvim('command_output', 'tabclose')) -- close last 6, current tab is now 5
- eq("tabclosed:5:5:4", nvim('command_output', 'close')) -- close last window on tab, closes tab
- eq("tabclosed:2:2:3", nvim('command_output', '2tabclose')) -- close tab 2, current tab is now 3
- eq("tabclosed:1:1:2\ntabclosed:1:1:1", nvim('command_output', 'tabonly')) -- close tabs 1 and 2
+ eq("tabclosed:6:6:5", nvim('exec', 'tabclose', true)) -- close last 6, current tab is now 5
+ eq("tabclosed:5:5:4", nvim('exec', 'close', true)) -- close last window on tab, closes tab
+ eq("tabclosed:2:2:3", nvim('exec', '2tabclose', true)) -- close tab 2, current tab is now 3
+ eq("tabclosed:1:1:2\ntabclosed:1:1:1", nvim('exec', 'tabonly', true)) -- close tabs 1 and 2
end)
it('is triggered when closing a window via bdelete from another tab', function()
@@ -23,7 +23,7 @@ describe('TabClosed', function()
nvim('command', '1tabedit Xtestfile')
nvim('command', 'normal! 1gt')
eq({1, 3}, nvim('eval', '[tabpagenr(), tabpagenr("$")]'))
- eq("tabclosed:2:2:1\ntabclosed:2:2:1", nvim('command_output', 'bdelete Xtestfile'))
+ eq("tabclosed:2:2:1\ntabclosed:2:2:1", nvim('exec', 'bdelete Xtestfile', true))
eq({1, 1}, nvim('eval', '[tabpagenr(), tabpagenr("$")]'))
end)
@@ -35,7 +35,7 @@ describe('TabClosed', function()
-- Only one tab is closed, and the alternate file is used for the other.
eq({2, 3}, nvim('eval', '[tabpagenr(), tabpagenr("$")]'))
- eq("tabclosed:2:2:2", nvim('command_output', 'bdelete Xtestfile2'))
+ eq("tabclosed:2:2:2", nvim('exec', 'bdelete Xtestfile2', true))
eq('Xtestfile1', nvim('eval', 'bufname("")'))
end)
end)
@@ -48,9 +48,9 @@ describe('TabClosed', function()
nvim('command', 'tabnew')
until nvim('eval', 'tabpagenr()') == 7 -- current tab is now 7
-- sanity check, we shouldn't match on tabs with numbers other than 2
- eq("tabclosed:7:7:6", nvim('command_output', 'tabclose'))
+ eq("tabclosed:7:7:6", nvim('exec', 'tabclose', true))
-- close tab page 2, current tab is now 5
- eq("tabclosed:2:2:5\ntabclosed:match", nvim('command_output', '2tabclose'))
+ eq("tabclosed:2:2:5\ntabclosed:match", nvim('exec', '2tabclose', true))
end)
end)
@@ -59,7 +59,7 @@ describe('TabClosed', function()
nvim('command', 'au! TabClosed * echom "tabclosed:".expand("<afile>").":".expand("<amatch>").":".tabpagenr()')
nvim('command', 'tabedit Xtestfile')
eq({2, 2}, nvim('eval', '[tabpagenr(), tabpagenr("$")]'))
- eq("tabclosed:2:2:1", nvim('command_output', 'close'))
+ eq("tabclosed:2:2:1", nvim('exec', 'close', true))
eq({1, 1}, nvim('eval', '[tabpagenr(), tabpagenr("$")]'))
end)
end)
diff --git a/test/functional/autocmd/tabnewentered_spec.lua b/test/functional/autocmd/tabnewentered_spec.lua
index 59cac07b34..32e341184d 100644
--- a/test/functional/autocmd/tabnewentered_spec.lua
+++ b/test/functional/autocmd/tabnewentered_spec.lua
@@ -7,15 +7,15 @@ describe('TabNewEntered', function()
it('matches when entering any new tab', function()
clear()
nvim('command', 'au! TabNewEntered * echom "tabnewentered:".tabpagenr().":".bufnr("")')
- eq("tabnewentered:2:2", nvim('command_output', 'tabnew'))
- eq("tabnewentered:3:3", nvim('command_output', 'tabnew test.x2'))
+ eq("tabnewentered:2:2", nvim('exec', 'tabnew', true))
+ eq("tabnewentered:3:3", nvim('exec', 'tabnew test.x2', true))
end)
end)
describe('with FILE as <afile>', function()
it('matches when opening a new tab for FILE', function()
nvim('command', 'au! TabNewEntered Xtest-tabnewentered echom "tabnewentered:match"')
eq('tabnewentered:4:4\ntabnewentered:match',
- nvim('command_output', 'tabnew Xtest-tabnewentered'))
+ nvim('exec', 'tabnew Xtest-tabnewentered', true))
end)
end)
describe('with CTRL-W T', function()
@@ -24,7 +24,7 @@ describe('TabNewEntered', function()
nvim('command', 'au! TabNewEntered * echom "entered"')
nvim('command', 'tabnew test.x2')
nvim('command', 'split')
- eq('entered', nvim('command_output', 'execute "normal \\<C-W>T"'))
+ eq('entered', nvim('exec', 'execute "normal \\<C-W>T"', true))
end)
end)
end)
diff --git a/test/functional/ex_cmds/script_spec.lua b/test/functional/ex_cmds/script_spec.lua
index 4e57d2755d..0a772c559b 100644
--- a/test/functional/ex_cmds/script_spec.lua
+++ b/test/functional/ex_cmds/script_spec.lua
@@ -22,7 +22,7 @@ describe('script_get-based command', function()
%s %s
endif
]])):format(cmd, garbage)))
- eq('', meths.command_output('messages'))
+ eq('', meths.exec('messages', true))
if check_neq then
neq(0, exc_exec(dedent([[
%s %s
@@ -37,7 +37,7 @@ describe('script_get-based command', function()
EOF
endif
]])):format(cmd, garbage)))
- eq('', meths.command_output('messages'))
+ eq('', meths.exec('messages', true))
if check_neq then
eq(true, pcall(source, (dedent([[
let g:exc = 0
diff --git a/test/functional/ex_cmds/sign_spec.lua b/test/functional/ex_cmds/sign_spec.lua
index 9d08a66625..891cfe1670 100644
--- a/test/functional/ex_cmds/sign_spec.lua
+++ b/test/functional/ex_cmds/sign_spec.lua
@@ -16,8 +16,8 @@ describe('sign', function()
nvim('command', 'sign place 34 line=3 name=Foo buffer='..buf2)
-- now unplace without specifying a buffer
nvim('command', 'sign unplace 34')
- eq("--- Signs ---\n", nvim('command_output', 'sign place buffer='..buf1))
- eq("--- Signs ---\n", nvim('command_output', 'sign place buffer='..buf2))
+ eq("--- Signs ---\n", nvim('exec', 'sign place buffer='..buf1, true))
+ eq("--- Signs ---\n", nvim('exec', 'sign place buffer='..buf2, true))
end)
end)
end)
diff --git a/test/functional/options/keymap_spec.lua b/test/functional/options/keymap_spec.lua
index 7f6d623dc7..52a714f7a8 100644
--- a/test/functional/options/keymap_spec.lua
+++ b/test/functional/options/keymap_spec.lua
@@ -30,7 +30,7 @@ describe("'keymap' / :lmap", function()
command('lmapclear <buffer>')
command('set keymap=dvorak')
command('set nomore')
- local bindings = funcs.nvim_command_output('lmap')
+ local bindings = funcs.nvim_exec('lmap', true)
eq(dedent([[
l " @_
diff --git a/test/functional/terminal/buffer_spec.lua b/test/functional/terminal/buffer_spec.lua
index 2fc7a021cb..d40baca871 100644
--- a/test/functional/terminal/buffer_spec.lua
+++ b/test/functional/terminal/buffer_spec.lua
@@ -60,7 +60,7 @@ describe(':terminal buffer', function()
end)
it('does not create swap files', function()
- local swapfile = nvim('command_output', 'swapname'):gsub('\n', '')
+ local swapfile = nvim('exec', 'swapname', true):gsub('\n', '')
eq(nil, io.open(swapfile))
end)
diff --git a/test/functional/ui/cmdline_highlight_spec.lua b/test/functional/ui/cmdline_highlight_spec.lua
index 052414a43d..9c746b99bd 100644
--- a/test/functional/ui/cmdline_highlight_spec.lua
+++ b/test/functional/ui/cmdline_highlight_spec.lua
@@ -362,7 +362,7 @@ describe('Command-line coloring', function()
{EOB:~ }|
:e^ |
]])
- eq('', meths.command_output('messages'))
+ eq('', meths.exec('messages', true))
end)
it('silences :echon', function()
set_color_cb('Echoning')
@@ -377,7 +377,7 @@ describe('Command-line coloring', function()
{EOB:~ }|
:e^ |
]])
- eq('', meths.command_output('messages'))
+ eq('', meths.exec('messages', true))
end)
it('silences :echomsg', function()
set_color_cb('Echomsging')
@@ -392,7 +392,7 @@ describe('Command-line coloring', function()
{EOB:~ }|
:e^ |
]])
- eq('', meths.command_output('messages'))
+ eq('', meths.exec('messages', true))
end)
it('does the right thing when throwing', function()
set_color_cb('Throwing')
@@ -857,7 +857,7 @@ describe('Ex commands coloring', function()
]])
feed('<CR>')
eq('Error detected while processing :\nE605: Exception not caught: 42\nE749: empty buffer',
- meths.command_output('messages'))
+ meths.exec('messages', true))
end)
it('errors out when failing to get callback', function()
meths.set_var('Nvim_color_cmdline', 42)
diff --git a/test/functional/ui/messages_spec.lua b/test/functional/ui/messages_spec.lua
index 40ea030f73..25b38b1feb 100644
--- a/test/functional/ui/messages_spec.lua
+++ b/test/functional/ui/messages_spec.lua
@@ -861,7 +861,7 @@ describe('ui/builtin messages', function()
-- screen size doesn't affect internal output #10285
eq('ErrorMsg xxx ctermfg=15 ctermbg=1 guifg=White guibg=Red',
- meths.command_output("hi ErrorMsg"))
+ meths.exec("hi ErrorMsg", true))
end)
it(':syntax list langGroup output', function()
@@ -900,7 +900,7 @@ vimComment xxx match /\s"[^\-:.%#=*].*$/ms=s+1,lc=1 excludenl contains=@vim
match /\<endif\s\+".*$/ms=s+5,lc=5 contains=@vimCommentGroup,vimCommentString
match /\<else\s\+".*$/ms=s+4,lc=4 contains=@vimCommentGroup,vimCommentString
links to Comment]],
- meths.command_output('syntax list vimComment'))
+ meths.exec('syntax list vimComment', true))
-- luacheck: pop
end)