From c30f2e3182e3b50e7c03932027ac55edfc8ada4a Mon Sep 17 00:00:00 2001 From: Lewis Russell Date: Fri, 12 Jan 2024 12:44:54 +0000 Subject: test: typing for helpers.meths --- test/functional/vimscript/null_spec.lua | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'test/functional/vimscript/null_spec.lua') diff --git a/test/functional/vimscript/null_spec.lua b/test/functional/vimscript/null_spec.lua index acdd844aff..efc3c451f8 100644 --- a/test/functional/vimscript/null_spec.lua +++ b/test/functional/vimscript/null_spec.lua @@ -9,15 +9,15 @@ local funcs = helpers.funcs local eq = helpers.eq local function redir_exec(cmd) - meths.set_var('__redir_exec_cmd', cmd) + meths.nvim_set_var('__redir_exec_cmd', cmd) command([[ redir => g:__redir_exec_output silent! execute g:__redir_exec_cmd redir END ]]) - local ret = meths.get_var('__redir_exec_output') - meths.del_var('__redir_exec_output') - meths.del_var('__redir_exec_cmd') + local ret = meths.nvim_get_var('__redir_exec_output') + meths.nvim_del_var('__redir_exec_output') + meths.nvim_del_var('__redir_exec_cmd') return ret end @@ -44,7 +44,7 @@ describe('NULL', function() if val == nil then eq(0, funcs.exists('g:_var')) else - eq(val, meths.get_var('_var')) + eq(val, meths.nvim_get_var('_var')) end if after ~= nil then after() -- cgit From 4f81f506f96f8b5bfcf00e952ceb492d3ce9dc6e Mon Sep 17 00:00:00 2001 From: Lewis Russell Date: Fri, 12 Jan 2024 13:11:28 +0000 Subject: test: normalise nvim bridge functions - remove helpers.cur*meths - remove helpers.nvim --- test/functional/vimscript/null_spec.lua | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'test/functional/vimscript/null_spec.lua') diff --git a/test/functional/vimscript/null_spec.lua b/test/functional/vimscript/null_spec.lua index efc3c451f8..2e96ccfead 100644 --- a/test/functional/vimscript/null_spec.lua +++ b/test/functional/vimscript/null_spec.lua @@ -1,6 +1,5 @@ local helpers = require('test.functional.helpers')(after_each) -local curbufmeths = helpers.curbufmeths local exc_exec = helpers.exc_exec local command = helpers.command local clear = helpers.clear @@ -72,10 +71,10 @@ describe('NULL', function() null_expr_test('is not locked', 'islocked("v:_null_list")', 0, 0) null_test('is accepted by :for', 'for x in L|throw x|endfor', 0) null_expr_test('does not crash append()', 'append(0, L)', 0, 0, function() - eq({ '' }, curbufmeths.get_lines(0, -1, false)) + eq({ '' }, meths.nvim_buf_get_lines(0, 0, -1, false)) end) null_expr_test('does not crash setline()', 'setline(1, L)', 0, 0, function() - eq({ '' }, curbufmeths.get_lines(0, -1, false)) + eq({ '' }, meths.nvim_buf_get_lines(0, 0, -1, false)) end) null_expr_test('is identical to itself', 'L is L', 0, 1) null_expr_test('can be sliced', 'L[:]', 0, {}) @@ -184,7 +183,7 @@ describe('NULL', function() 0, '', function() - eq({ '' }, curbufmeths.get_lines(0, -1, false)) + eq({ '' }, meths.nvim_buf_get_lines(0, 0, -1, false)) end ) null_expr_test('is accepted by setmatches()', 'setmatches(L)', 0, 0) -- cgit From 795f896a5772d5e0795f86642bdf90c82efac45c Mon Sep 17 00:00:00 2001 From: Lewis Russell Date: Fri, 12 Jan 2024 17:59:57 +0000 Subject: test: rename (meths, funcs) -> (api, fn) --- test/functional/vimscript/null_spec.lua | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'test/functional/vimscript/null_spec.lua') diff --git a/test/functional/vimscript/null_spec.lua b/test/functional/vimscript/null_spec.lua index 2e96ccfead..805cd13844 100644 --- a/test/functional/vimscript/null_spec.lua +++ b/test/functional/vimscript/null_spec.lua @@ -3,20 +3,20 @@ local helpers = require('test.functional.helpers')(after_each) local exc_exec = helpers.exc_exec local command = helpers.command local clear = helpers.clear -local meths = helpers.meths -local funcs = helpers.funcs +local api = helpers.api +local fn = helpers.fn local eq = helpers.eq local function redir_exec(cmd) - meths.nvim_set_var('__redir_exec_cmd', cmd) + api.nvim_set_var('__redir_exec_cmd', cmd) command([[ redir => g:__redir_exec_output silent! execute g:__redir_exec_cmd redir END ]]) - local ret = meths.nvim_get_var('__redir_exec_output') - meths.nvim_del_var('__redir_exec_output') - meths.nvim_del_var('__redir_exec_cmd') + local ret = api.nvim_get_var('__redir_exec_output') + api.nvim_del_var('__redir_exec_output') + api.nvim_del_var('__redir_exec_cmd') return ret end @@ -41,9 +41,9 @@ describe('NULL', function() it(name, function() eq((err == 0) and '' or ('\n' .. err), redir_exec('let g:_var = ' .. expr)) if val == nil then - eq(0, funcs.exists('g:_var')) + eq(0, fn.exists('g:_var')) else - eq(val, meths.nvim_get_var('_var')) + eq(val, api.nvim_get_var('_var')) end if after ~= nil then after() @@ -71,10 +71,10 @@ describe('NULL', function() null_expr_test('is not locked', 'islocked("v:_null_list")', 0, 0) null_test('is accepted by :for', 'for x in L|throw x|endfor', 0) null_expr_test('does not crash append()', 'append(0, L)', 0, 0, function() - eq({ '' }, meths.nvim_buf_get_lines(0, 0, -1, false)) + eq({ '' }, api.nvim_buf_get_lines(0, 0, -1, false)) end) null_expr_test('does not crash setline()', 'setline(1, L)', 0, 0, function() - eq({ '' }, meths.nvim_buf_get_lines(0, 0, -1, false)) + eq({ '' }, api.nvim_buf_get_lines(0, 0, -1, false)) end) null_expr_test('is identical to itself', 'L is L', 0, 1) null_expr_test('can be sliced', 'L[:]', 0, {}) @@ -183,7 +183,7 @@ describe('NULL', function() 0, '', function() - eq({ '' }, meths.nvim_buf_get_lines(0, 0, -1, false)) + eq({ '' }, api.nvim_buf_get_lines(0, 0, -1, false)) end ) null_expr_test('is accepted by setmatches()', 'setmatches(L)', 0, 0) -- cgit