mirror of
https://github.com/neovim/neovim.git
synced 2025-10-21 17:21:49 +00:00
fix(api, lua): return NIL on failure to find converted function (#17779)
This commit is contained in:
@@ -6,6 +6,7 @@ local assert_alive = helpers.assert_alive
|
||||
local NIL = helpers.NIL
|
||||
local clear, nvim, eq, neq = helpers.clear, helpers.nvim, helpers.eq, helpers.neq
|
||||
local command = helpers.command
|
||||
local exec = helpers.exec
|
||||
local eval = helpers.eval
|
||||
local expect = helpers.expect
|
||||
local funcs = helpers.funcs
|
||||
@@ -1271,6 +1272,17 @@ describe('API', function()
|
||||
eq('Key is locked: lua', pcall_err(meths.del_var, 'lua'))
|
||||
eq('Key is locked: lua', pcall_err(meths.set_var, 'lua', 1))
|
||||
|
||||
exec([[
|
||||
function Test()
|
||||
endfunction
|
||||
function s:Test()
|
||||
endfunction
|
||||
let g:Unknown_func = function('Test')
|
||||
let g:Unknown_script_func = function('s:Test')
|
||||
]])
|
||||
eq(NIL, meths.get_var('Unknown_func'))
|
||||
eq(NIL, meths.get_var('Unknown_script_func'))
|
||||
|
||||
-- Check if autoload works properly
|
||||
local pathsep = helpers.get_pathsep()
|
||||
local xconfig = 'Xhome' .. pathsep .. 'Xconfig'
|
||||
|
Reference in New Issue
Block a user