aboutsummaryrefslogtreecommitdiff
path: root/test/functional/lua/overrides_spec.lua
diff options
context:
space:
mode:
authorLewis Russell <lewis6991@gmail.com>2024-01-12 17:59:57 +0000
committerLewis Russell <lewis6991@gmail.com>2024-01-12 18:59:14 +0000
commit795f896a5772d5e0795f86642bdf90c82efac45c (patch)
tree308f04fbee18d2ec3f00c12a8bec96b84d8907f0 /test/functional/lua/overrides_spec.lua
parent4f81f506f96f8b5bfcf00e952ceb492d3ce9dc6e (diff)
downloadrneovim-795f896a5772d5e0795f86642bdf90c82efac45c.tar.gz
rneovim-795f896a5772d5e0795f86642bdf90c82efac45c.tar.bz2
rneovim-795f896a5772d5e0795f86642bdf90c82efac45c.zip
test: rename (meths, funcs) -> (api, fn)
Diffstat (limited to 'test/functional/lua/overrides_spec.lua')
-rw-r--r--test/functional/lua/overrides_spec.lua24
1 files changed, 12 insertions, 12 deletions
diff --git a/test/functional/lua/overrides_spec.lua b/test/functional/lua/overrides_spec.lua
index 12110a86c9..ecbdde3bfd 100644
--- a/test/functional/lua/overrides_spec.lua
+++ b/test/functional/lua/overrides_spec.lua
@@ -6,8 +6,8 @@ local eq = helpers.eq
local NIL = vim.NIL
local feed = helpers.feed
local clear = helpers.clear
-local funcs = helpers.funcs
-local meths = helpers.meths
+local fn = helpers.fn
+local api = helpers.api
local command = helpers.command
local write_file = helpers.write_file
local exec_capture = helpers.exec_capture
@@ -25,15 +25,15 @@ end)
describe('print', function()
it('returns nothing', function()
- eq(NIL, funcs.luaeval('print("abc")'))
- eq(0, funcs.luaeval('select("#", print("abc"))'))
+ eq(NIL, fn.luaeval('print("abc")'))
+ eq(0, fn.luaeval('select("#", print("abc"))'))
end)
it('allows catching printed text with :execute', function()
- eq('\nabc', funcs.execute('lua print("abc")'))
- eq('\nabc', funcs.execute('luado print("abc")'))
- eq('\nabc', funcs.execute('call luaeval("print(\'abc\')")'))
+ eq('\nabc', fn.execute('lua print("abc")'))
+ eq('\nabc', fn.execute('luado print("abc")'))
+ eq('\nabc', fn.execute('call luaeval("print(\'abc\')")'))
write_file(fname, 'print("abc")')
- eq('\nabc', funcs.execute('luafile ' .. fname))
+ eq('\nabc', fn.execute('luafile ' .. fname))
eq('abc', exec_capture('lua print("abc")'))
eq('abc', exec_capture('luado print("abc")'))
@@ -113,7 +113,7 @@ describe('print', function()
eq('Vim(lua):E5108: Error executing lua [NULL]', pcall_err(command, 'lua bad_custom_error()'))
end)
it('prints strings with NULs and NLs correctly', function()
- meths.nvim_set_option_value('more', true, {})
+ api.nvim_set_option_value('more', true, {})
eq(
'abc ^@ def\nghi^@^@^@jkl\nTEST\n\n\nT\n',
exec_capture([[lua print("abc \0 def\nghi\0\0\0jkl\nTEST\n\n\nT\n")]])
@@ -332,17 +332,17 @@ end)
describe('os.getenv', function()
it('returns nothing for undefined env var', function()
- eq(NIL, funcs.luaeval('os.getenv("XTEST_1")'))
+ eq(NIL, fn.luaeval('os.getenv("XTEST_1")'))
end)
it('returns env var set by the parent process', function()
local value = 'foo'
clear({ env = { ['XTEST_1'] = value } })
- eq(value, funcs.luaeval('os.getenv("XTEST_1")'))
+ eq(value, fn.luaeval('os.getenv("XTEST_1")'))
end)
it('returns env var set by let', function()
local value = 'foo'
command('let $XTEST_1 = "' .. value .. '"')
- eq(value, funcs.luaeval('os.getenv("XTEST_1")'))
+ eq(value, fn.luaeval('os.getenv("XTEST_1")'))
end)
end)