aboutsummaryrefslogtreecommitdiff
path: root/test/functional/legacy
diff options
context:
space:
mode:
Diffstat (limited to 'test/functional/legacy')
-rw-r--r--test/functional/legacy/011_autocommands_spec.lua5
-rw-r--r--test/functional/legacy/012_directory_spec.lua25
-rw-r--r--test/functional/legacy/039_visual_block_mode_commands_spec.lua4
-rw-r--r--test/functional/legacy/074_global_var_in_viminfo_spec.lua3
-rw-r--r--test/functional/legacy/assert_spec.lua6
-rw-r--r--test/functional/legacy/autochdir_spec.lua4
-rw-r--r--test/functional/legacy/autocmd_option_spec.lua25
-rw-r--r--test/functional/legacy/buffer_spec.lua8
-rw-r--r--test/functional/legacy/cmdline_spec.lua18
-rw-r--r--test/functional/legacy/edit_spec.lua2
-rw-r--r--test/functional/legacy/ex_mode_spec.lua4
-rw-r--r--test/functional/legacy/excmd_spec.lua8
-rw-r--r--test/functional/legacy/filechanged_spec.lua10
-rw-r--r--test/functional/legacy/fnamemodify_spec.lua4
-rw-r--r--test/functional/legacy/increment_spec.lua8
-rw-r--r--test/functional/legacy/mapping_spec.lua16
-rw-r--r--test/functional/legacy/messages_spec.lua8
-rw-r--r--test/functional/legacy/mksession_spec.lua6
-rw-r--r--test/functional/legacy/move_spec.lua4
-rw-r--r--test/functional/legacy/prompt_buffer_spec.lua20
-rw-r--r--test/functional/legacy/put_spec.lua4
-rw-r--r--test/functional/legacy/search_spec.lua20
-rw-r--r--test/functional/legacy/undolevels_spec.lua4
-rw-r--r--test/functional/legacy/vimscript_spec.lua4
24 files changed, 109 insertions, 111 deletions
diff --git a/test/functional/legacy/011_autocommands_spec.lua b/test/functional/legacy/011_autocommands_spec.lua
index 0cce6bcd11..eba878b99a 100644
--- a/test/functional/legacy/011_autocommands_spec.lua
+++ b/test/functional/legacy/011_autocommands_spec.lua
@@ -13,7 +13,6 @@
-- being modified outside of Vim (noticed on Solaris).
local helpers = require('test.functional.helpers')(after_each)
-local luv = require('luv')
local clear, feed_command, expect, eq, neq, dedent, write_file, feed =
helpers.clear,
helpers.feed_command,
@@ -37,8 +36,8 @@ local function prepare_gz_file(name, text)
-- Compress the file with gzip.
command([[call system(['gzip', '--force', ']] .. name .. [['])]])
-- This should create the .gz file and delete the original.
- neq(nil, luv.fs_stat(name .. '.gz'))
- eq(nil, luv.fs_stat(name))
+ neq(nil, vim.uv.fs_stat(name .. '.gz'))
+ eq(nil, vim.uv.fs_stat(name))
end
describe('file reading, writing and bufnew and filter autocommands', function()
diff --git a/test/functional/legacy/012_directory_spec.lua b/test/functional/legacy/012_directory_spec.lua
index f78648a328..b428318e3f 100644
--- a/test/functional/legacy/012_directory_spec.lua
+++ b/test/functional/legacy/012_directory_spec.lua
@@ -4,13 +4,12 @@
-- - "dir", in directory relative to current dir
local helpers = require('test.functional.helpers')(after_each)
-local luv = require('luv')
local eq = helpers.eq
local neq = helpers.neq
local poke_eventloop = helpers.poke_eventloop
-local funcs = helpers.funcs
-local meths = helpers.meths
+local fn = helpers.fn
+local api = helpers.api
local clear = helpers.clear
local insert = helpers.insert
local command = helpers.command
@@ -57,33 +56,33 @@ describe("'directory' option", function()
line 3 Abcdefghij
end of testfile]])
- meths.set_option_value('swapfile', true, {})
- meths.set_option_value('swapfile', true, {})
- meths.set_option_value('directory', '.', {})
+ api.nvim_set_option_value('swapfile', true, {})
+ api.nvim_set_option_value('swapfile', true, {})
+ api.nvim_set_option_value('directory', '.', {})
-- sanity check: files should not exist yet.
- eq(nil, luv.fs_stat('.Xtest1.swp'))
+ eq(nil, vim.uv.fs_stat('.Xtest1.swp'))
command('edit! Xtest1')
poke_eventloop()
- eq('Xtest1', funcs.buffer_name('%'))
+ eq('Xtest1', fn.buffer_name('%'))
-- Verify that the swapfile exists. In the legacy test this was done by
-- reading the output from :!ls.
- neq(nil, luv.fs_stat('.Xtest1.swp'))
+ neq(nil, vim.uv.fs_stat('.Xtest1.swp'))
- meths.set_option_value('directory', './Xtest2,.', {})
+ api.nvim_set_option_value('directory', './Xtest2,.', {})
command('edit Xtest1')
poke_eventloop()
-- swapfile should no longer exist in CWD.
- eq(nil, luv.fs_stat('.Xtest1.swp'))
+ eq(nil, vim.uv.fs_stat('.Xtest1.swp'))
eq({ 'Xtest1.swp', 'Xtest3' }, ls_dir_sorted('Xtest2'))
- meths.set_option_value('directory', 'Xtest.je', {})
+ api.nvim_set_option_value('directory', 'Xtest.je', {})
command('bdelete')
command('edit Xtest2/Xtest3')
- eq(true, meths.get_option_value('swapfile', {}))
+ eq(true, api.nvim_get_option_value('swapfile', {}))
poke_eventloop()
eq({ 'Xtest3' }, ls_dir_sorted('Xtest2'))
diff --git a/test/functional/legacy/039_visual_block_mode_commands_spec.lua b/test/functional/legacy/039_visual_block_mode_commands_spec.lua
index ae2cc1abbe..626035d74c 100644
--- a/test/functional/legacy/039_visual_block_mode_commands_spec.lua
+++ b/test/functional/legacy/039_visual_block_mode_commands_spec.lua
@@ -2,7 +2,7 @@
-- And test "U" in Visual mode, also on German sharp S.
local helpers = require('test.functional.helpers')(after_each)
-local nvim, eq = helpers.meths, helpers.eq
+local nvim, eq = helpers.api, helpers.eq
local insert, feed = helpers.insert, helpers.feed
local clear, expect = helpers.clear, helpers.expect
local feed_command = helpers.feed_command
@@ -204,7 +204,7 @@ describe('Visual block mode', function()
feed('G2l')
feed('2k<C-v>$gj<ESC>')
feed_command([[let cpos=getpos("'>")]])
- local cpos = nvim.get_var('cpos')
+ local cpos = nvim.nvim_get_var('cpos')
local expected = {
col = 4,
off = 0,
diff --git a/test/functional/legacy/074_global_var_in_viminfo_spec.lua b/test/functional/legacy/074_global_var_in_viminfo_spec.lua
index 3a4ab31bea..0a9ad330c2 100644
--- a/test/functional/legacy/074_global_var_in_viminfo_spec.lua
+++ b/test/functional/legacy/074_global_var_in_viminfo_spec.lua
@@ -1,7 +1,6 @@
-- Tests for storing global variables in the .shada file
local helpers = require('test.functional.helpers')(after_each)
-local luv = require('luv')
local clear, command, eq, neq, eval, poke_eventloop =
helpers.clear, helpers.command, helpers.eq, helpers.neq, helpers.eval, helpers.poke_eventloop
@@ -134,7 +133,7 @@ describe('storing global variables in ShaDa files', function()
poke_eventloop()
-- Assert that the shada file exists.
- neq(nil, luv.fs_stat(tempname))
+ neq(nil, vim.uv.fs_stat(tempname))
command('unlet MY_GLOBAL_DICT')
command('unlet MY_GLOBAL_LIST')
-- Assert that the variables where deleted.
diff --git a/test/functional/legacy/assert_spec.lua b/test/functional/legacy/assert_spec.lua
index 006f71aa4f..04c90281a7 100644
--- a/test/functional/legacy/assert_spec.lua
+++ b/test/functional/legacy/assert_spec.lua
@@ -1,16 +1,16 @@
local helpers = require('test.functional.helpers')(after_each)
-local nvim, call = helpers.meths, helpers.call
+local nvim, call = helpers.api, helpers.call
local clear, eq = helpers.clear, helpers.eq
local source, command = helpers.source, helpers.command
local exc_exec = helpers.exc_exec
local eval = helpers.eval
local function expected_errors(errors)
- eq(errors, nvim.get_vvar('errors'))
+ eq(errors, nvim.nvim_get_vvar('errors'))
end
local function expected_empty()
- eq({}, nvim.get_vvar('errors'))
+ eq({}, nvim.nvim_get_vvar('errors'))
end
describe('assert function:', function()
diff --git a/test/functional/legacy/autochdir_spec.lua b/test/functional/legacy/autochdir_spec.lua
index c6517a20aa..e5980f5942 100644
--- a/test/functional/legacy/autochdir_spec.lua
+++ b/test/functional/legacy/autochdir_spec.lua
@@ -1,11 +1,11 @@
local helpers = require('test.functional.helpers')(after_each)
local clear, eq, matches = helpers.clear, helpers.eq, helpers.matches
-local eval, command, call, meths = helpers.eval, helpers.command, helpers.call, helpers.meths
+local eval, command, call, api = helpers.eval, helpers.command, helpers.call, helpers.api
local source, exec_capture = helpers.source, helpers.exec_capture
local mkdir = helpers.mkdir
local function expected_empty()
- eq({}, meths.get_vvar('errors'))
+ eq({}, api.nvim_get_vvar('errors'))
end
describe('autochdir behavior', function()
diff --git a/test/functional/legacy/autocmd_option_spec.lua b/test/functional/legacy/autocmd_option_spec.lua
index 88618aeb2c..9966df263b 100644
--- a/test/functional/legacy/autocmd_option_spec.lua
+++ b/test/functional/legacy/autocmd_option_spec.lua
@@ -1,8 +1,9 @@
local helpers = require('test.functional.helpers')(after_each)
-local nvim = helpers.meths
+local nvim = helpers.api
local clear, eq, neq, eval = helpers.clear, helpers.eq, helpers.neq, helpers.eval
-local curbuf, buf = helpers.curbuf, helpers.bufmeths
-local curwin = helpers.curwin
+local api = helpers.api
+local curbuf = helpers.api.nvim_get_current_buf
+local curwin = helpers.api.nvim_get_current_win
local exec_capture = helpers.exec_capture
local source, command = helpers.source, helpers.command
@@ -38,7 +39,7 @@ local function init_var()
end
local function get_result()
- local ret = nvim.get_var('ret')
+ local ret = nvim.nvim_get_var('ret')
init_var()
return ret
end
@@ -210,7 +211,7 @@ describe('au OptionSet', function()
it('should trigger if the current buffer is different from the targeted buffer', function()
local new_buffer = make_buffer()
- local new_bufnr = buf.get_number(new_buffer)
+ local new_bufnr = api.nvim_buf_get_number(new_buffer)
command('call setbufvar(' .. new_bufnr .. ', "&buftype", "nofile")')
expected_combination({
@@ -647,7 +648,7 @@ describe('au OptionSet', function()
set_hook('buftype')
local new_buffer = make_buffer()
- local new_bufnr = buf.get_number(new_buffer)
+ local new_bufnr = api.nvim_buf_get_number(new_buffer)
command('call setbufvar(' .. new_bufnr .. ', "&buftype", "nofile")')
expected_combination({
@@ -696,24 +697,24 @@ describe('au OptionSet', function()
it('should trigger if a boolean option be set globally', function()
set_hook('autochdir')
- nvim.set_option_value('autochdir', true, { scope = 'global' })
- eq(true, nvim.get_option_value('autochdir', { scope = 'global' }))
+ nvim.nvim_set_option_value('autochdir', true, { scope = 'global' })
+ eq(true, nvim.nvim_get_option_value('autochdir', { scope = 'global' }))
expected_combination({ 'autochdir', false, '', false, true, 'global', 'setglobal' })
end)
it('should trigger if a number option be set globally', function()
set_hook('cmdheight')
- nvim.set_option_value('cmdheight', 5, { scope = 'global' })
- eq(5, nvim.get_option_value('cmdheight', { scope = 'global' }))
+ nvim.nvim_set_option_value('cmdheight', 5, { scope = 'global' })
+ eq(5, nvim.nvim_get_option_value('cmdheight', { scope = 'global' }))
expected_combination({ 'cmdheight', 1, '', 1, 5, 'global', 'setglobal' })
end)
it('should trigger if a string option be set globally', function()
set_hook('ambiwidth')
- nvim.set_option_value('ambiwidth', 'double', { scope = 'global' })
- eq('double', nvim.get_option_value('ambiwidth', { scope = 'global' }))
+ nvim.nvim_set_option_value('ambiwidth', 'double', { scope = 'global' })
+ eq('double', nvim.nvim_get_option_value('ambiwidth', { scope = 'global' }))
expected_combination({
'ambiwidth',
'single',
diff --git a/test/functional/legacy/buffer_spec.lua b/test/functional/legacy/buffer_spec.lua
index 1e8909f0d0..b3964540f0 100644
--- a/test/functional/legacy/buffer_spec.lua
+++ b/test/functional/legacy/buffer_spec.lua
@@ -1,16 +1,16 @@
local helpers = require('test.functional.helpers')(after_each)
local clear, source = helpers.clear, helpers.source
-local call, eq, meths = helpers.call, helpers.eq, helpers.meths
+local call, eq, api = helpers.call, helpers.eq, helpers.api
local function expected_empty()
- eq({}, meths.get_vvar('errors'))
+ eq({}, api.nvim_get_vvar('errors'))
end
describe('buffer', function()
before_each(function()
clear()
- meths.ui_attach(80, 24, {})
- meths.set_option_value('hidden', false, {})
+ api.nvim_ui_attach(80, 24, {})
+ api.nvim_set_option_value('hidden', false, {})
end)
it('deleting a modified buffer with :confirm', function()
diff --git a/test/functional/legacy/cmdline_spec.lua b/test/functional/legacy/cmdline_spec.lua
index 99731bb80b..8c94451f9a 100644
--- a/test/functional/legacy/cmdline_spec.lua
+++ b/test/functional/legacy/cmdline_spec.lua
@@ -5,8 +5,8 @@ local command = helpers.command
local feed = helpers.feed
local feed_command = helpers.feed_command
local exec = helpers.exec
-local meths = helpers.meths
-local pesc = helpers.pesc
+local api = helpers.api
+local pesc = vim.pesc
describe('cmdline', function()
before_each(clear)
@@ -198,9 +198,9 @@ describe('cmdline', function()
[3] = { reverse = true }, -- TabLineFill
})
screen:attach()
- meths.set_option_value('laststatus', 2, {})
- meths.set_option_value('showtabline', 2, {})
- meths.set_option_value('cmdheight', 1, {})
+ api.nvim_set_option_value('laststatus', 2, {})
+ api.nvim_set_option_value('showtabline', 2, {})
+ api.nvim_set_option_value('cmdheight', 1, {})
screen:expect([[
{2: [No Name] }{3: }|
^ |
@@ -217,10 +217,10 @@ describe('cmdline', function()
[0] = { bold = true, foreground = Screen.colors.Blue }, -- NonText
}
screen:attach()
- meths.set_option_value('ruler', true, {})
- meths.set_option_value('rulerformat', 'longish', {})
- meths.set_option_value('laststatus', 0, {})
- meths.set_option_value('winwidth', 1, {})
+ api.nvim_set_option_value('ruler', true, {})
+ api.nvim_set_option_value('rulerformat', 'longish', {})
+ api.nvim_set_option_value('laststatus', 0, {})
+ api.nvim_set_option_value('winwidth', 1, {})
feed [[<C-W>v<C-W>|<C-W>p]]
screen:expect [[
│^ |
diff --git a/test/functional/legacy/edit_spec.lua b/test/functional/legacy/edit_spec.lua
index 59e9805a91..0762e5e671 100644
--- a/test/functional/legacy/edit_spec.lua
+++ b/test/functional/legacy/edit_spec.lua
@@ -4,7 +4,7 @@ local clear = helpers.clear
local command = helpers.command
local expect = helpers.expect
local feed = helpers.feed
-local sleep = helpers.sleep
+local sleep = vim.uv.sleep
before_each(clear)
diff --git a/test/functional/legacy/ex_mode_spec.lua b/test/functional/legacy/ex_mode_spec.lua
index 90abf9ebd7..ae4c4309d1 100644
--- a/test/functional/legacy/ex_mode_spec.lua
+++ b/test/functional/legacy/ex_mode_spec.lua
@@ -5,7 +5,7 @@ local command = helpers.command
local eq = helpers.eq
local eval = helpers.eval
local feed = helpers.feed
-local meths = helpers.meths
+local api = helpers.api
local poke_eventloop = helpers.poke_eventloop
before_each(clear)
@@ -16,7 +16,7 @@ describe('Ex mode', function()
feed('gQ' .. cmd .. '<C-b>"<CR>')
local ret = eval('@:[1:]') -- Remove leading quote.
feed('visual<CR>')
- eq(meths.replace_termcodes(expected, true, true, true), ret)
+ eq(api.nvim_replace_termcodes(expected, true, true, true), ret)
end
command('set sw=2')
test_ex_edit('bar', 'foo bar<C-u>bar')
diff --git a/test/functional/legacy/excmd_spec.lua b/test/functional/legacy/excmd_spec.lua
index ba41a983e2..41f14c4645 100644
--- a/test/functional/legacy/excmd_spec.lua
+++ b/test/functional/legacy/excmd_spec.lua
@@ -6,8 +6,8 @@ local exec = helpers.exec
local exec_lua = helpers.exec_lua
local expect_exit = helpers.expect_exit
local feed = helpers.feed
-local funcs = helpers.funcs
-local meths = helpers.meths
+local fn = helpers.fn
+local api = helpers.api
local read_file = helpers.read_file
local source = helpers.source
local eq = helpers.eq
@@ -24,7 +24,7 @@ end
describe('Ex command', function()
before_each(clear)
after_each(function()
- eq({}, meths.get_vvar('errors'))
+ eq({}, api.nvim_get_vvar('errors'))
end)
it('checks for address line overflow', function()
@@ -340,7 +340,7 @@ describe(':confirm command dialog', function()
feed('<CR>') -- suppress hit-enter prompt
-- Try to write with read-only file permissions.
- funcs.setfperm('Xconfirm_write_ro', 'r--r--r--')
+ fn.setfperm('Xconfirm_write_ro', 'r--r--r--')
feed(':set noro | silent undo | confirm w\n')
screen:expect([[
foobar |
diff --git a/test/functional/legacy/filechanged_spec.lua b/test/functional/legacy/filechanged_spec.lua
index c8e772f597..46ecfdcd63 100644
--- a/test/functional/legacy/filechanged_spec.lua
+++ b/test/functional/legacy/filechanged_spec.lua
@@ -1,19 +1,19 @@
local helpers = require('test.functional.helpers')(after_each)
local clear, source = helpers.clear, helpers.source
-local call, eq, meths = helpers.call, helpers.eq, helpers.meths
+local call, eq, api = helpers.call, helpers.eq, helpers.api
local is_os = helpers.is_os
local skip = helpers.skip
local function expected_empty()
- eq({}, meths.get_vvar('errors'))
+ eq({}, api.nvim_get_vvar('errors'))
end
describe('file changed dialog', function()
before_each(function()
clear()
- meths.ui_attach(80, 24, {})
- meths.set_option_value('autoread', false, {})
- meths.set_option_value('fsync', true, {})
+ api.nvim_ui_attach(80, 24, {})
+ api.nvim_set_option_value('autoread', false, {})
+ api.nvim_set_option_value('fsync', true, {})
end)
it('works', function()
diff --git a/test/functional/legacy/fnamemodify_spec.lua b/test/functional/legacy/fnamemodify_spec.lua
index 6262db3a2f..570b523d92 100644
--- a/test/functional/legacy/fnamemodify_spec.lua
+++ b/test/functional/legacy/fnamemodify_spec.lua
@@ -2,10 +2,10 @@
local helpers = require('test.functional.helpers')(after_each)
local clear, source = helpers.clear, helpers.source
-local call, eq, nvim = helpers.call, helpers.eq, helpers.meths
+local call, eq, nvim = helpers.call, helpers.eq, helpers.api
local function expected_empty()
- eq({}, nvim.get_vvar('errors'))
+ eq({}, nvim.nvim_get_vvar('errors'))
end
describe('filename modifiers', function()
diff --git a/test/functional/legacy/increment_spec.lua b/test/functional/legacy/increment_spec.lua
index 212ad041c0..a81044114c 100644
--- a/test/functional/legacy/increment_spec.lua
+++ b/test/functional/legacy/increment_spec.lua
@@ -3,7 +3,7 @@
local helpers = require('test.functional.helpers')(after_each)
local source, command = helpers.source, helpers.command
local call, clear = helpers.call, helpers.clear
-local eq, nvim = helpers.eq, helpers.meths
+local eq, nvim = helpers.eq, helpers.api
describe('Ctrl-A/Ctrl-X on visual selections', function()
before_each(function()
@@ -743,18 +743,18 @@ describe('Ctrl-A/Ctrl-X on visual selections', function()
it('works on Test ' .. id, function()
command('set nrformats&vi') -- &vi makes Vim compatible
call('Test_visual_increment_' .. id)
- eq({}, nvim.get_vvar('errors'))
+ eq({}, nvim.nvim_get_vvar('errors'))
end)
end
it('does not drop leading zeroes', function()
command('set nrformats&vi') -- &vi makes Vim compatible
call('Test_normal_increment_01')
- eq({}, nvim.get_vvar('errors'))
+ eq({}, nvim.nvim_get_vvar('errors'))
end)
it('maintains correct column after CTRL-A', function()
call('Test_normal_increment_02')
- eq({}, nvim.get_vvar('errors'))
+ eq({}, nvim.nvim_get_vvar('errors'))
end)
end)
diff --git a/test/functional/legacy/mapping_spec.lua b/test/functional/legacy/mapping_spec.lua
index 28efb912f8..9eddec40f7 100644
--- a/test/functional/legacy/mapping_spec.lua
+++ b/test/functional/legacy/mapping_spec.lua
@@ -3,8 +3,8 @@
local helpers = require('test.functional.helpers')(after_each)
local clear, feed, insert = helpers.clear, helpers.feed, helpers.insert
local expect, poke_eventloop = helpers.expect, helpers.poke_eventloop
-local command, eq, eval, meths = helpers.command, helpers.eq, helpers.eval, helpers.meths
-local sleep = helpers.sleep
+local command, eq, eval, api = helpers.command, helpers.eq, helpers.eval, helpers.api
+local sleep = vim.uv.sleep
describe('mapping', function()
before_each(clear)
@@ -134,9 +134,9 @@ describe('mapping', function()
command('nnoremap <LeftDrag> <LeftDrag><Cmd><CR>')
poke_eventloop()
- meths.input_mouse('left', 'press', '', 0, 0, 0)
+ api.nvim_input_mouse('left', 'press', '', 0, 0, 0)
poke_eventloop()
- meths.input_mouse('left', 'drag', '', 0, 0, 1)
+ api.nvim_input_mouse('left', 'drag', '', 0, 0, 1)
poke_eventloop()
eq('s', eval('mode()'))
end)
@@ -147,9 +147,9 @@ describe('mapping', function()
command('inoremap <LeftDrag> <LeftDrag><Cmd>let g:dragged = 1<CR>')
feed('i')
poke_eventloop()
- meths.input_mouse('left', 'press', '', 0, 0, 0)
+ api.nvim_input_mouse('left', 'press', '', 0, 0, 0)
poke_eventloop()
- meths.input_mouse('left', 'drag', '', 0, 0, 1)
+ api.nvim_input_mouse('left', 'drag', '', 0, 0, 1)
poke_eventloop()
eq(1, eval('g:dragged'))
eq('v', eval('mode()'))
@@ -158,9 +158,9 @@ describe('mapping', function()
command([[inoremap <LeftDrag> <LeftDrag><C-\><C-N>]])
feed('i')
poke_eventloop()
- meths.input_mouse('left', 'press', '', 0, 0, 0)
+ api.nvim_input_mouse('left', 'press', '', 0, 0, 0)
poke_eventloop()
- meths.input_mouse('left', 'drag', '', 0, 0, 1)
+ api.nvim_input_mouse('left', 'drag', '', 0, 0, 1)
poke_eventloop()
eq('n', eval('mode()'))
end)
diff --git a/test/functional/legacy/messages_spec.lua b/test/functional/legacy/messages_spec.lua
index 97c6d23494..593d03fa90 100644
--- a/test/functional/legacy/messages_spec.lua
+++ b/test/functional/legacy/messages_spec.lua
@@ -4,7 +4,7 @@ local clear = helpers.clear
local command = helpers.command
local exec = helpers.exec
local feed = helpers.feed
-local meths = helpers.meths
+local api = helpers.api
local nvim_dir = helpers.nvim_dir
local assert_alive = helpers.assert_alive
@@ -410,9 +410,9 @@ describe('messages', function()
screen:attach()
command('cd ' .. nvim_dir)
- meths.set_option_value('shell', './shell-test', {})
- meths.set_option_value('shellcmdflag', 'REP 20', {})
- meths.set_option_value('shellxquote', '', {}) -- win: avoid extra quotes
+ api.nvim_set_option_value('shell', './shell-test', {})
+ api.nvim_set_option_value('shellcmdflag', 'REP 20', {})
+ api.nvim_set_option_value('shellxquote', '', {}) -- win: avoid extra quotes
-- display a page and go back, results in exactly the same view
feed([[:4 verbose echo system('foo')<CR>]])
diff --git a/test/functional/legacy/mksession_spec.lua b/test/functional/legacy/mksession_spec.lua
index bca9cd833c..689d918cd9 100644
--- a/test/functional/legacy/mksession_spec.lua
+++ b/test/functional/legacy/mksession_spec.lua
@@ -1,7 +1,7 @@
local helpers = require('test.functional.helpers')(after_each)
local clear = helpers.clear
local command = helpers.command
-local funcs = helpers.funcs
+local fn = helpers.fn
local eq = helpers.eq
describe('mksession', function()
@@ -18,7 +18,7 @@ describe('mksession', function()
command('mksession! Xtest_mks.out')
local found_rtp = 0
local found_pp = 0
- for _, line in pairs(funcs.readfile('Xtest_mks.out', 'b')) do
+ for _, line in pairs(fn.readfile('Xtest_mks.out', 'b')) do
if line:find('set runtimepath') then
found_rtp = found_rtp + 1
end
@@ -32,7 +32,7 @@ describe('mksession', function()
command('set sessionoptions+=skiprtp')
command('mksession! Xtest_mks.out')
local found_rtp_or_pp = 0
- for _, line in pairs(funcs.readfile('Xtest_mks.out', 'b')) do
+ for _, line in pairs(fn.readfile('Xtest_mks.out', 'b')) do
if line:find('set runtimepath') or line:find('set packpath') then
found_rtp_or_pp = found_rtp_or_pp + 1
end
diff --git a/test/functional/legacy/move_spec.lua b/test/functional/legacy/move_spec.lua
index 512823be6c..1500d48ad9 100644
--- a/test/functional/legacy/move_spec.lua
+++ b/test/functional/legacy/move_spec.lua
@@ -2,7 +2,7 @@ local helpers = require('test.functional.helpers')(after_each)
local Screen = require('test.functional.ui.screen')
local clear = helpers.clear
local feed = helpers.feed
-local funcs = helpers.funcs
+local fn = helpers.fn
before_each(clear)
@@ -15,7 +15,7 @@ describe(':move', function()
})
screen:attach()
- funcs.setline(1, { 'First', 'Second', 'Third', 'Fourth' })
+ fn.setline(1, { 'First', 'Second', 'Third', 'Fourth' })
feed('gg:move +1<CR>')
screen:expect([[
Second |
diff --git a/test/functional/legacy/prompt_buffer_spec.lua b/test/functional/legacy/prompt_buffer_spec.lua
index 76c57a23b9..0c6898526e 100644
--- a/test/functional/legacy/prompt_buffer_spec.lua
+++ b/test/functional/legacy/prompt_buffer_spec.lua
@@ -5,7 +5,7 @@ local source = helpers.source
local clear = helpers.clear
local command = helpers.command
local poke_eventloop = helpers.poke_eventloop
-local meths = helpers.meths
+local api = helpers.api
local eq = helpers.eq
local neq = helpers.neq
@@ -180,12 +180,12 @@ describe('prompt buffer', function()
call timer_start(0, {-> nvim_buf_set_lines(s:buf, -1, -1, 0, ['walrus'])})
]]
poke_eventloop()
- eq({ mode = 'i', blocking = false }, meths.get_mode())
+ eq({ mode = 'i', blocking = false }, api.nvim_get_mode())
end)
-- oldtest: Test_prompt_appending_while_hidden()
it('accessing hidden prompt buffer does not start insert mode', function()
- local prev_win = meths.get_current_win()
+ local prev_win = api.nvim_get_current_win()
source([[
new prompt
set buftype=prompt
@@ -205,16 +205,16 @@ describe('prompt buffer', function()
endfunc
]])
feed('asomething<CR>')
- eq('something', meths.get_var('entered'))
- neq(prev_win, meths.get_current_win())
+ eq('something', api.nvim_get_var('entered'))
+ neq(prev_win, api.nvim_get_current_win())
feed('exit<CR>')
- eq(prev_win, meths.get_current_win())
- eq({ mode = 'n', blocking = false }, meths.get_mode())
+ eq(prev_win, api.nvim_get_current_win())
+ eq({ mode = 'n', blocking = false }, api.nvim_get_mode())
command('call DoAppend()')
- eq({ mode = 'n', blocking = false }, meths.get_mode())
+ eq({ mode = 'n', blocking = false }, api.nvim_get_mode())
feed('i')
- eq({ mode = 'i', blocking = false }, meths.get_mode())
+ eq({ mode = 'i', blocking = false }, api.nvim_get_mode())
command('call DoAppend()')
- eq({ mode = 'i', blocking = false }, meths.get_mode())
+ eq({ mode = 'i', blocking = false }, api.nvim_get_mode())
end)
end)
diff --git a/test/functional/legacy/put_spec.lua b/test/functional/legacy/put_spec.lua
index 791656cc03..c78946d690 100644
--- a/test/functional/legacy/put_spec.lua
+++ b/test/functional/legacy/put_spec.lua
@@ -2,7 +2,7 @@ local helpers = require('test.functional.helpers')(after_each)
local Screen = require('test.functional.ui.screen')
local clear = helpers.clear
local exec_lua = helpers.exec_lua
-local meths = helpers.meths
+local api = helpers.api
local source = helpers.source
local eq = helpers.eq
@@ -16,7 +16,7 @@ end
describe('put', function()
before_each(clear)
after_each(function()
- eq({}, meths.get_vvar('errors'))
+ eq({}, api.nvim_get_vvar('errors'))
end)
it('very large count 64-bit', function()
diff --git a/test/functional/legacy/search_spec.lua b/test/functional/legacy/search_spec.lua
index 7ddf81cff8..70748c9d27 100644
--- a/test/functional/legacy/search_spec.lua
+++ b/test/functional/legacy/search_spec.lua
@@ -5,7 +5,7 @@ local command = helpers.command
local eq = helpers.eq
local eval = helpers.eval
local feed = helpers.feed
-local funcs = helpers.funcs
+local fn = helpers.fn
local poke_eventloop = helpers.poke_eventloop
local exec = helpers.exec
@@ -27,7 +27,7 @@ describe('search cmdline', function()
end)
local function tenlines()
- funcs.setline(1, {
+ fn.setline(1, {
' 1',
' 2 these',
' 3 the',
@@ -68,7 +68,7 @@ describe('search cmdline', function()
3 {inc:the} |
/the^ |
]])
- eq({ 0, 0, 0, 0 }, funcs.getpos('"'))
+ eq({ 0, 0, 0, 0 }, fn.getpos('"'))
feed('<C-G>')
screen:expect([[
3 the |
@@ -125,7 +125,7 @@ describe('search cmdline', function()
end,
}
feed('<CR>')
- eq({ 0, 0, 0, 0 }, funcs.getpos('"'))
+ eq({ 0, 0, 0, 0 }, fn.getpos('"'))
end
end
@@ -368,7 +368,7 @@ describe('search cmdline', function()
end)
it('can traverse matches in the same line with <C-G>/<C-T>', function()
- funcs.setline(1, { ' 1', ' 2 these', ' 3 the theother' })
+ fn.setline(1, { ' 1', ' 2 these', ' 3 the theother' })
command('1')
command('set incsearch')
@@ -465,7 +465,7 @@ describe('search cmdline', function()
coladd = 0,
skipcol = 0,
curswant = 4,
- }, funcs.winsaveview())
+ }, fn.winsaveview())
end)
it('restores original view after failed search', function()
@@ -500,14 +500,14 @@ describe('search cmdline', function()
coladd = 0,
skipcol = 0,
curswant = 0,
- }, funcs.winsaveview())
+ }, fn.winsaveview())
end)
-- oldtest: Test_search_cmdline4().
it("CTRL-G with 'incsearch' and ? goes in the right direction", function()
screen:try_resize(40, 4)
command('enew!')
- funcs.setline(1, { ' 1 the first', ' 2 the second', ' 3 the third' })
+ fn.setline(1, { ' 1 the first', ' 2 the second', ' 3 the third' })
command('set laststatus=0 shortmess+=s')
command('set incsearch')
command('$')
@@ -608,7 +608,7 @@ describe('search cmdline', function()
it('incsearch works with :sort', function()
screen:try_resize(20, 4)
command('set incsearch hlsearch scrolloff=0')
- funcs.setline(1, { 'another one 2', 'that one 3', 'the one 1' })
+ fn.setline(1, { 'another one 2', 'that one 3', 'the one 1' })
feed(':sort ni u /on')
screen:expect([[
@@ -624,7 +624,7 @@ describe('search cmdline', function()
it('incsearch works with :vimgrep family', function()
screen:try_resize(30, 4)
command('set incsearch hlsearch scrolloff=0')
- funcs.setline(1, { 'another one 2', 'that one 3', 'the one 1' })
+ fn.setline(1, { 'another one 2', 'that one 3', 'the one 1' })
feed(':vimgrep on')
screen:expect([[
diff --git a/test/functional/legacy/undolevels_spec.lua b/test/functional/legacy/undolevels_spec.lua
index 1dfc4c17ba..e8badc6864 100644
--- a/test/functional/legacy/undolevels_spec.lua
+++ b/test/functional/legacy/undolevels_spec.lua
@@ -1,6 +1,6 @@
local helpers = require('test.functional.helpers')(after_each)
local source, clear = helpers.source, helpers.clear
-local eq, nvim = helpers.eq, helpers.meths
+local eq, nvim = helpers.eq, helpers.api
describe('undolevel', function()
setup(clear)
@@ -57,6 +57,6 @@ describe('undolevel', function()
call Test_global_local_undolevels()
]])
- eq({}, nvim.get_vvar('errors'))
+ eq({}, nvim.nvim_get_vvar('errors'))
end)
end)
diff --git a/test/functional/legacy/vimscript_spec.lua b/test/functional/legacy/vimscript_spec.lua
index c97208059b..8b0a920a3e 100644
--- a/test/functional/legacy/vimscript_spec.lua
+++ b/test/functional/legacy/vimscript_spec.lua
@@ -3,7 +3,7 @@ local Screen = require('test.functional.ui.screen')
local clear = helpers.clear
local exec = helpers.exec
local feed = helpers.feed
-local meths = helpers.meths
+local api = helpers.api
before_each(clear)
@@ -12,7 +12,7 @@ describe('Vim script', function()
it('Error when if/for/while/try/function is nested too deep', function()
local screen = Screen.new(80, 24)
screen:attach()
- meths.set_option_value('laststatus', 2, {})
+ api.nvim_set_option_value('laststatus', 2, {})
exec([[
" Deep nesting of if ... endif
func Test1()