aboutsummaryrefslogtreecommitdiff
path: root/test/functional/core
diff options
context:
space:
mode:
authorLewis Russell <lewis6991@gmail.com>2024-01-12 12:44:54 +0000
committerLewis Russell <lewis6991@gmail.com>2024-01-12 13:01:06 +0000
commitc30f2e3182e3b50e7c03932027ac55edfc8ada4a (patch)
treeedf0a76dba282d946f67fe70fff8c6cbe28e7a82 /test/functional/core
parent284e0ad26dd9de90c3a813dd1b357a425eca6bad (diff)
downloadrneovim-c30f2e3182e3b50e7c03932027ac55edfc8ada4a.tar.gz
rneovim-c30f2e3182e3b50e7c03932027ac55edfc8ada4a.tar.bz2
rneovim-c30f2e3182e3b50e7c03932027ac55edfc8ada4a.zip
test: typing for helpers.meths
Diffstat (limited to 'test/functional/core')
-rw-r--r--test/functional/core/channels_spec.lua20
-rw-r--r--test/functional/core/fileio_spec.lua6
-rw-r--r--test/functional/core/job_spec.lua24
-rw-r--r--test/functional/core/spellfile_spec.lua20
-rw-r--r--test/functional/core/startup_spec.lua18
5 files changed, 44 insertions, 44 deletions
diff --git a/test/functional/core/channels_spec.lua b/test/functional/core/channels_spec.lua
index 570dda0730..566b8e4250 100644
--- a/test/functional/core/channels_spec.lua
+++ b/test/functional/core/channels_spec.lua
@@ -38,7 +38,7 @@ describe('channels', function()
set_session(client)
source(init)
- meths.set_var('address', address)
+ meths.nvim_set_var('address', address)
command("let g:id = sockconnect('pipe', address, {'on_data':'OnEvent'})")
local id = eval('g:id')
ok(id > 0)
@@ -46,7 +46,7 @@ describe('channels', function()
command("call chansend(g:id, msgpackdump([[2,'nvim_set_var',['code',23]]]))")
set_session(server)
retry(nil, 1000, function()
- eq(23, meths.get_var('code'))
+ eq(23, meths.nvim_get_var('code'))
end)
set_session(client)
@@ -67,8 +67,8 @@ describe('channels', function()
\ 'on_exit': function('OnEvent'),
\ }
]])
- meths.set_var('nvim_prog', nvim_prog)
- meths.set_var(
+ meths.nvim_set_var('nvim_prog', nvim_prog)
+ meths.nvim_set_var(
'code',
[[
function! OnEvent(id, data, event) dict
@@ -117,8 +117,8 @@ describe('channels', function()
\ 'on_exit': function('OnEvent'),
\ }
]])
- meths.set_var('nvim_prog', nvim_prog)
- meths.set_var(
+ meths.nvim_set_var('nvim_prog', nvim_prog)
+ meths.nvim_set_var(
'code',
[[
function! OnStdin(id, data, event) dict
@@ -165,8 +165,8 @@ describe('channels', function()
\ 'pty': v:true,
\ }
]])
- meths.set_var('nvim_prog', nvim_prog)
- meths.set_var(
+ meths.nvim_set_var('nvim_prog', nvim_prog)
+ meths.nvim_set_var(
'code',
[[
function! OnEvent(id, data, event) dict
@@ -220,8 +220,8 @@ describe('channels', function()
\ 'rpc': v:true,
\ }
]])
- meths.set_var('nvim_prog', nvim_prog)
- meths.set_var(
+ meths.nvim_set_var('nvim_prog', nvim_prog)
+ meths.nvim_set_var(
'code',
[[
let id = stdioopen({'rpc':v:true})
diff --git a/test/functional/core/fileio_spec.lua b/test/functional/core/fileio_spec.lua
index 6b821869ee..229d127b6d 100644
--- a/test/functional/core/fileio_spec.lua
+++ b/test/functional/core/fileio_spec.lua
@@ -409,14 +409,14 @@ describe('tmpdir', function()
funcs.tempname()
funcs.tempname()
funcs.tempname()
- eq('', meths.get_vvar('errmsg'))
+ eq('', meths.nvim_get_vvar('errmsg'))
rm_tmpdir()
funcs.tempname()
funcs.tempname()
funcs.tempname()
- eq('E5431: tempdir disappeared (2 times)', meths.get_vvar('errmsg'))
+ eq('E5431: tempdir disappeared (2 times)', meths.nvim_get_vvar('errmsg'))
rm_tmpdir()
- eq('E5431: tempdir disappeared (3 times)', meths.get_vvar('errmsg'))
+ eq('E5431: tempdir disappeared (3 times)', meths.nvim_get_vvar('errmsg'))
end)
it('$NVIM_APPNAME relative path', function()
diff --git a/test/functional/core/job_spec.lua b/test/functional/core/job_spec.lua
index e1baa6f48f..5d5be2851b 100644
--- a/test/functional/core/job_spec.lua
+++ b/test/functional/core/job_spec.lua
@@ -403,11 +403,11 @@ describe('jobs', function()
it('can get the pid value using getpid', function()
nvim('command', "let j = jobstart(['cat', '-'], g:job_opts)")
local pid = eval('jobpid(j)')
- neq(NIL, meths.get_proc(pid))
+ neq(NIL, meths.nvim_get_proc(pid))
nvim('command', 'call jobstop(j)')
eq({ 'notification', 'stdout', { 0, { '' } } }, next_msg())
eq({ 'notification', 'exit', { 0, 143 } }, next_msg())
- eq(NIL, meths.get_proc(pid))
+ eq(NIL, meths.nvim_get_proc(pid))
end)
it('disposed on Nvim exit', function()
@@ -417,9 +417,9 @@ describe('jobs', function()
"let g:j = jobstart(has('win32') ? ['ping', '-n', '1001', '127.0.0.1'] : ['sleep', '1000'], g:job_opts)"
)
local pid = eval('jobpid(g:j)')
- neq(NIL, meths.get_proc(pid))
+ neq(NIL, meths.nvim_get_proc(pid))
clear()
- eq(NIL, meths.get_proc(pid))
+ eq(NIL, meths.nvim_get_proc(pid))
end)
it('can survive the exit of nvim with "detach"', function()
@@ -429,9 +429,9 @@ describe('jobs', function()
"let g:j = jobstart(has('win32') ? ['ping', '-n', '1001', '127.0.0.1'] : ['sleep', '1000'], g:job_opts)"
)
local pid = eval('jobpid(g:j)')
- neq(NIL, meths.get_proc(pid))
+ neq(NIL, meths.nvim_get_proc(pid))
clear()
- neq(NIL, meths.get_proc(pid))
+ neq(NIL, meths.nvim_get_proc(pid))
-- clean up after ourselves
eq(0, os_kill(pid))
end)
@@ -948,7 +948,7 @@ describe('jobs', function()
]],
}
feed('<CR>')
- funcs.jobstop(meths.get_var('id'))
+ funcs.jobstop(meths.nvim_get_var('id'))
end)
end)
@@ -1066,7 +1066,7 @@ describe('jobs', function()
local children
if is_os('win') then
local status, result = pcall(retry, nil, nil, function()
- children = meths.get_proc_children(ppid)
+ children = meths.nvim_get_proc_children(ppid)
-- On Windows conhost.exe may exist, and
-- e.g. vctip.exe might appear. #10783
ok(#children >= 3 and #children <= 5)
@@ -1078,13 +1078,13 @@ describe('jobs', function()
end
else
retry(nil, nil, function()
- children = meths.get_proc_children(ppid)
+ children = meths.nvim_get_proc_children(ppid)
eq(3, #children)
end)
end
-- Assert that nvim_get_proc() sees the children.
for _, child_pid in ipairs(children) do
- local info = meths.get_proc(child_pid)
+ local info = meths.nvim_get_proc(child_pid)
-- eq((is_os('win') and 'nvim.exe' or 'nvim'), info.name)
eq(ppid, info.ppid)
end
@@ -1093,7 +1093,7 @@ describe('jobs', function()
-- Assert that the children were killed.
retry(nil, nil, function()
for _, child_pid in ipairs(children) do
- eq(NIL, meths.get_proc(child_pid))
+ eq(NIL, meths.nvim_get_proc(child_pid))
end
end)
end)
@@ -1129,7 +1129,7 @@ describe('jobs', function()
local j
local function send(str)
-- check no nvim_chan_free double free with pty job (#14198)
- meths.chan_send(j, str)
+ meths.nvim_chan_send(j, str)
end
before_each(function()
diff --git a/test/functional/core/spellfile_spec.lua b/test/functional/core/spellfile_spec.lua
index 60cdf88fe3..0e2d71ef14 100644
--- a/test/functional/core/spellfile_spec.lua
+++ b/test/functional/core/spellfile_spec.lua
@@ -24,7 +24,7 @@ describe('spellfile', function()
-- │ ┌ Spell file version (#VIMSPELLVERSION)
local spellheader = 'VIMspell\050'
it('errors out when prefcond section is truncated', function()
- meths.set_option_value('runtimepath', testdir, {})
+ meths.nvim_set_option_value('runtimepath', testdir, {})
-- stylua: ignore
write_file(testdir .. '/spell/en.ascii.spl',
-- ┌ Section identifier (#SN_PREFCOND)
@@ -35,11 +35,11 @@ describe('spellfile', function()
-- │ ┌ Condition length (1 byte)
-- │ │ ┌ Condition regex (missing!)
.. '\000\001\001')
- meths.set_option_value('spelllang', 'en', {})
+ meths.nvim_set_option_value('spelllang', 'en', {})
eq('Vim(set):E758: Truncated spell file', exc_exec('set spell'))
end)
it('errors out when prefcond regexp contains NUL byte', function()
- meths.set_option_value('runtimepath', testdir, {})
+ meths.nvim_set_option_value('runtimepath', testdir, {})
-- stylua: ignore
write_file(testdir .. '/spell/en.ascii.spl',
-- ┌ Section identifier (#SN_PREFCOND)
@@ -55,11 +55,11 @@ describe('spellfile', function()
-- │ ┌ KWORDTREE tree length (4 bytes)
-- │ │ ┌ PREFIXTREE tree length
.. '\000\000\000\000\000\000\000\000\000\000\000\000')
- meths.set_option_value('spelllang', 'en', {})
+ meths.nvim_set_option_value('spelllang', 'en', {})
eq('Vim(set):E759: Format error in spell file', exc_exec('set spell'))
end)
it('errors out when region contains NUL byte', function()
- meths.set_option_value('runtimepath', testdir, {})
+ meths.nvim_set_option_value('runtimepath', testdir, {})
-- stylua: ignore
write_file(testdir .. '/spell/en.ascii.spl',
-- ┌ Section identifier (#SN_REGION)
@@ -72,11 +72,11 @@ describe('spellfile', function()
-- │ ┌ KWORDTREE tree length (4 bytes)
-- │ │ ┌ PREFIXTREE tree length
.. '\000\000\000\000\000\000\000\000\000\000\000\000')
- meths.set_option_value('spelllang', 'en', {})
+ meths.nvim_set_option_value('spelllang', 'en', {})
eq('Vim(set):E759: Format error in spell file', exc_exec('set spell'))
end)
it('errors out when SAL section contains NUL byte', function()
- meths.set_option_value('runtimepath', testdir, {})
+ meths.nvim_set_option_value('runtimepath', testdir, {})
-- stylua: ignore
write_file(testdir .. '/spell/en.ascii.spl',
-- ┌ Section identifier (#SN_SAL)
@@ -96,13 +96,13 @@ describe('spellfile', function()
-- │ ┌ KWORDTREE tree length (4 bytes)
-- │ │ ┌ PREFIXTREE tree length
.. '\000\000\000\000\000\000\000\000\000\000\000\000')
- meths.set_option_value('spelllang', 'en', {})
+ meths.nvim_set_option_value('spelllang', 'en', {})
eq('Vim(set):E759: Format error in spell file', exc_exec('set spell'))
end)
it('errors out when spell header contains NUL bytes', function()
- meths.set_option_value('runtimepath', testdir, {})
+ meths.nvim_set_option_value('runtimepath', testdir, {})
write_file(testdir .. '/spell/en.ascii.spl', spellheader:sub(1, -3) .. '\000\000')
- meths.set_option_value('spelllang', 'en', {})
+ meths.nvim_set_option_value('spelllang', 'en', {})
eq('Vim(set):E757: This does not look like a spell file', exc_exec('set spell'))
end)
end)
diff --git a/test/functional/core/startup_spec.lua b/test/functional/core/startup_spec.lua
index 5d2da8f5e0..39d38a47a5 100644
--- a/test/functional/core/startup_spec.lua
+++ b/test/functional/core/startup_spec.lua
@@ -38,7 +38,7 @@ describe('startup', function()
clear()
ok(
string.find(
- alter_slashes(meths.get_option_value('runtimepath', {})),
+ alter_slashes(meths.nvim_get_option_value('runtimepath', {})),
funcs.stdpath('config'),
1,
true
@@ -47,7 +47,7 @@ describe('startup', function()
clear('--clean')
ok(
string.find(
- alter_slashes(meths.get_option_value('runtimepath', {})),
+ alter_slashes(meths.nvim_get_option_value('runtimepath', {})),
funcs.stdpath('config'),
1,
true
@@ -737,11 +737,11 @@ describe('startup', function()
os.remove('Xdiff.vim')
end)
clear { args = { '-u', 'Xdiff.vim', '-d', 'Xdiff.vim', 'Xdiff.vim' } }
- eq(true, meths.get_option_value('diff', { win = funcs.win_getid(1) }))
- eq(true, meths.get_option_value('diff', { win = funcs.win_getid(2) }))
+ eq(true, meths.nvim_get_option_value('diff', { win = funcs.win_getid(1) }))
+ eq(true, meths.nvim_get_option_value('diff', { win = funcs.win_getid(2) }))
local float_win = funcs.win_getid(3)
- eq('editor', meths.win_get_config(float_win).relative)
- eq(false, meths.get_option_value('diff', { win = float_win }))
+ eq('editor', meths.nvim_win_get_config(float_win).relative)
+ eq(false, meths.nvim_get_option_value('diff', { win = float_win }))
end)
it('does not crash if --embed is given twice', function()
@@ -870,7 +870,7 @@ describe('startup', function()
exec_lua [[ return _G.test_loadorder ]]
)
- local rtp = meths.get_option_value('rtp', {})
+ local rtp = meths.nvim_get_option_value('rtp', {})
ok(
startswith(
rtp,
@@ -963,9 +963,9 @@ describe('startup', function()
os.remove('Xtab2.noft')
end)
clear({ args = { '-p', 'Xtab1.noft', 'Xtab2.noft' } })
- eq(81, meths.win_get_width(0))
+ eq(81, meths.nvim_win_get_width(0))
command('tabnext')
- eq(81, meths.win_get_width(0))
+ eq(81, meths.nvim_win_get_width(0))
end)
end)