diff options
Diffstat (limited to 'test/functional/ex_cmds')
-rw-r--r-- | test/functional/ex_cmds/append_spec.lua | 3 | ||||
-rw-r--r-- | test/functional/ex_cmds/ls_spec.lua | 2 | ||||
-rw-r--r-- | test/functional/ex_cmds/make_spec.lua | 4 | ||||
-rw-r--r-- | test/functional/ex_cmds/map_spec.lua | 2 | ||||
-rw-r--r-- | test/functional/ex_cmds/mksession_spec.lua | 14 | ||||
-rw-r--r-- | test/functional/ex_cmds/source_spec.lua | 2 | ||||
-rw-r--r-- | test/functional/ex_cmds/verbose_spec.lua | 4 | ||||
-rw-r--r-- | test/functional/ex_cmds/write_spec.lua | 8 |
8 files changed, 20 insertions, 19 deletions
diff --git a/test/functional/ex_cmds/append_spec.lua b/test/functional/ex_cmds/append_spec.lua index fadb5c9b42..e3a39384a6 100644 --- a/test/functional/ex_cmds/append_spec.lua +++ b/test/functional/ex_cmds/append_spec.lua @@ -8,6 +8,7 @@ local clear = helpers.clear local funcs = helpers.funcs local command = helpers.command local curbufmeths = helpers.curbufmeths +local meths = helpers.meths local Screen = require('test.functional.ui.screen') local cmdtest = function(cmd, prep, ret1) @@ -42,7 +43,7 @@ local cmdtest = function(cmd, prep, ret1) eq(hisline, funcs.histget(':', -2)) eq(cmd, funcs.histget(':')) -- Test that command-line window was launched - eq('nofile', curbufmeths.get_option('buftype')) + eq('nofile', meths.get_option_value('buftype', {buf=0})) eq('n', funcs.mode(1)) feed('<CR>') eq('c', funcs.mode(1)) diff --git a/test/functional/ex_cmds/ls_spec.lua b/test/functional/ex_cmds/ls_spec.lua index 2583d80269..d02af21731 100644 --- a/test/functional/ex_cmds/ls_spec.lua +++ b/test/functional/ex_cmds/ls_spec.lua @@ -14,7 +14,7 @@ describe(':ls', function() end) it('R, F for :terminal buffers', function() - nvim('set_option', 'shell', string.format('"%s" INTERACT', testprg('shell-test'))) + nvim('set_option_value', 'shell', string.format('"%s" INTERACT', testprg('shell-test')), {}) command('edit foo') command('set hidden') diff --git a/test/functional/ex_cmds/make_spec.lua b/test/functional/ex_cmds/make_spec.lua index 8d903330b1..d82f59ddf9 100644 --- a/test/functional/ex_cmds/make_spec.lua +++ b/test/functional/ex_cmds/make_spec.lua @@ -22,14 +22,14 @@ describe(':make', function() end) it('captures stderr & non zero exit code #14349', function () - nvim('set_option', 'makeprg', testprg('shell-test')..' foo') + nvim('set_option_value', 'makeprg', testprg('shell-test')..' foo', {}) local out = eval('execute("make")') -- Error message is captured in the file and printed in the footer matches('[\r\n]+.*[\r\n]+Unknown first argument%: foo[\r\n]+%(1 of 1%)%: Unknown first argument%: foo', out) end) it('captures stderr & zero exit code #14349', function () - nvim('set_option', 'makeprg', testprg('shell-test')) + nvim('set_option_value', 'makeprg', testprg('shell-test'), {}) local out = eval('execute("make")') -- Ensure there are no "shell returned X" messages between -- command and last line (indicating zero exit) diff --git a/test/functional/ex_cmds/map_spec.lua b/test/functional/ex_cmds/map_spec.lua index a197b81cc5..a580e88b93 100644 --- a/test/functional/ex_cmds/map_spec.lua +++ b/test/functional/ex_cmds/map_spec.lua @@ -18,7 +18,7 @@ describe(':*map', function() it('are not affected by &isident', function() meths.set_var('counter', 0) command('nnoremap <C-x> :let counter+=1<CR>') - meths.set_option('isident', ('%u'):format(('>'):byte())) + meths.set_option_value('isident', ('%u'):format(('>'):byte()), {}) command('nnoremap <C-y> :let counter+=1<CR>') -- &isident used to disable keycode parsing here as well feed('\24\25<C-x><C-y>') diff --git a/test/functional/ex_cmds/mksession_spec.lua b/test/functional/ex_cmds/mksession_spec.lua index d70ccb5b39..f51e7c62cb 100644 --- a/test/functional/ex_cmds/mksession_spec.lua +++ b/test/functional/ex_cmds/mksession_spec.lua @@ -81,13 +81,13 @@ describe(':mksession', function() local buf_count = #meths.list_bufs() eq(2, buf_count) - eq('terminal', meths.buf_get_option(0, 'buftype')) + eq('terminal', meths.get_option_value('buftype', { buf = 0 })) test_terminal_session_disabled(2) -- no terminal should be set. As a side effect we end up with a blank buffer - eq('', meths.buf_get_option(meths.list_bufs()[1], 'buftype')) - eq('', meths.buf_get_option(meths.list_bufs()[2], 'buftype')) + eq('', meths.get_option_value('buftype', { buf = meths.list_bufs()[1] })) + eq('', meths.get_option_value('buftype', { buf = meths.list_bufs()[2] })) end ) @@ -112,7 +112,7 @@ describe(':mksession', function() it('do not restore :terminal if not set in sessionoptions, only buffer #13078', function() command('terminal') - eq('terminal', meths.buf_get_option(0, 'buftype')) + eq('terminal', meths.get_option_value('buftype', { buf = 0 })) local buf_count = #meths.list_bufs() eq(1, buf_count) @@ -120,7 +120,7 @@ describe(':mksession', function() test_terminal_session_disabled(1) -- no terminal should be set - eq('', meths.buf_get_option(0, 'buftype')) + eq('', meths.get_option_value('buftype', { buf = 0 })) end) it('restores tab-local working directories', function() @@ -249,7 +249,7 @@ describe(':mksession', function() style = 'minimal', } meths.open_win(buf, false, config) - local cmdheight = meths.get_option('cmdheight') + local cmdheight = meths.get_option_value('cmdheight', {}) command('mksession ' .. session_file) -- Create a new test instance of Nvim. @@ -262,7 +262,7 @@ describe(':mksession', function() -- window was not restored. eq(1, funcs.winnr('$')) -- The command-line height should remain the same as it was. - eq(cmdheight, meths.get_option('cmdheight')) + eq(cmdheight, meths.get_option_value('cmdheight', {})) os.remove(tmpfile) end) diff --git a/test/functional/ex_cmds/source_spec.lua b/test/functional/ex_cmds/source_spec.lua index 41045f5cb4..02f5bff021 100644 --- a/test/functional/ex_cmds/source_spec.lua +++ b/test/functional/ex_cmds/source_spec.lua @@ -48,7 +48,7 @@ describe(':source', function() pending("'shellslash' only works on Windows") return end - meths.set_option('shellslash', false) + meths.set_option_value('shellslash', false, {}) mkdir('Xshellslash') write_file([[Xshellslash/Xstack.vim]], [[ diff --git a/test/functional/ex_cmds/verbose_spec.lua b/test/functional/ex_cmds/verbose_spec.lua index def09e2f9e..50077e9e0c 100644 --- a/test/functional/ex_cmds/verbose_spec.lua +++ b/test/functional/ex_cmds/verbose_spec.lua @@ -18,7 +18,7 @@ local function last_set_tests(cmd) script_location = table.concat{current_dir, helpers.get_pathsep(), script_file} write_file(script_file, [[ -vim.api.nvim_set_option('hlsearch', false) +vim.api.nvim_set_option_value('hlsearch', false, {}) vim.bo.expandtab = true vim.opt.number = true vim.api.nvim_set_keymap('n', '<leader>key1', ':echo "test"<cr>', {noremap = true}) @@ -160,7 +160,7 @@ describe('lua verbose:', function() clear() script_file = 'test_luafile.lua' write_file(script_file, [[ - vim.api.nvim_set_option('hlsearch', false) + vim.api.nvim_set_option_value('hlsearch', false, {}) ]]) exec(':source '..script_file) end) diff --git a/test/functional/ex_cmds/write_spec.lua b/test/functional/ex_cmds/write_spec.lua index 126646f21a..0b8ce93b09 100644 --- a/test/functional/ex_cmds/write_spec.lua +++ b/test/functional/ex_cmds/write_spec.lua @@ -129,18 +129,18 @@ describe(':write', function() eq(('Vim(write):E17: "'..funcs.fnamemodify('.', ':p:h')..'" is a directory'), pcall_err(command, 'write .')) end - meths.set_option('writeany', true) + meths.set_option_value('writeany', true, {}) -- Message from buf_write eq(('Vim(write):E502: "." is a directory'), pcall_err(command, 'write .')) funcs.mkdir(fname_bak) - meths.set_option('backupdir', '.') - meths.set_option('backup', true) + meths.set_option_value('backupdir', '.', {}) + meths.set_option_value('backup', true, {}) write_file(fname, 'content0') command('edit ' .. fname) funcs.setline(1, 'TTY') eq('Vim(write):E510: Can\'t make backup file (add ! to override)', pcall_err(command, 'write')) - meths.set_option('backup', false) + meths.set_option_value('backup', false, {}) funcs.setfperm(fname, 'r--------') eq('Vim(write):E505: "Xtest-functional-ex_cmds-write" is read-only (add ! to override)', pcall_err(command, 'write')) |