aboutsummaryrefslogtreecommitdiff
path: root/test/functional/lua/luaeval_spec.lua
diff options
context:
space:
mode:
authorBjörn Linse <bjorn.linse@gmail.com>2021-10-23 18:20:19 +0200
committerBjörn Linse <bjorn.linse@gmail.com>2021-10-23 18:24:00 +0200
commit9dd371bb2e60be4818c5d8fcd84274a700495fd9 (patch)
treec659c94014cf482a98c98bd869308459c0df304c /test/functional/lua/luaeval_spec.lua
parentfa4b24072e13dc7303e896701f0bb6d0227caf0c (diff)
downloadrneovim-9dd371bb2e60be4818c5d8fcd84274a700495fd9.tar.gz
rneovim-9dd371bb2e60be4818c5d8fcd84274a700495fd9.tar.bz2
rneovim-9dd371bb2e60be4818c5d8fcd84274a700495fd9.zip
feat(lua): document support of packages with v:lua syntax
this already worked in 0.5 but was not properly documented or tested
Diffstat (limited to 'test/functional/lua/luaeval_spec.lua')
-rw-r--r--test/functional/lua/luaeval_spec.lua6
1 files changed, 6 insertions, 0 deletions
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"))