From 9dd371bb2e60be4818c5d8fcd84274a700495fd9 Mon Sep 17 00:00:00 2001 From: Björn Linse Date: Sat, 23 Oct 2021 18:20:19 +0200 Subject: feat(lua): document support of packages with v:lua syntax this already worked in 0.5 but was not properly documented or tested --- test/functional/lua/luaeval_spec.lua | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'test/functional/lua/luaeval_spec.lua') diff --git a/test/functional/lua/luaeval_spec.lua b/test/functional/lua/luaeval_spec.lua index 0675ec9abd..ab76e71a12 100644 --- a/test/functional/lua/luaeval_spec.lua +++ b/test/functional/lua/luaeval_spec.lua @@ -527,6 +527,12 @@ describe('v:lua', function() ]]} end) + it('supports packages', function() + command('set pp+=test/functional/fixtures') + eq('\tbadval', eval("v:lua.require'leftpad'('badval')")) + eq(9003, eval("v:lua.require'bar'.doit()")) + end) + it('throw errors for invalid use', function() eq('Vim(let):E15: Invalid expression: v:lua.func', pcall_err(command, "let g:Func = v:lua.func")) eq('Vim(let):E15: Invalid expression: v:lua', pcall_err(command, "let g:Func = v:lua")) -- cgit