aboutsummaryrefslogtreecommitdiff
path: root/test/functional/lua/luaeval_spec.lua
diff options
context:
space:
mode:
authorSean Dewar <seandewar@users.noreply.github.com>2021-08-12 17:19:05 +0100
committerSean Dewar <seandewar@users.noreply.github.com>2021-08-12 22:35:25 +0100
commitda9005af792f7a7eaae98ee9f6499af9a97fd095 (patch)
tree33c56d2b3d5f658084b777d24d0426309955c995 /test/functional/lua/luaeval_spec.lua
parent5503d8e28b1636f07bff4123a824b9ffdde4ca29 (diff)
downloadrneovim-da9005af792f7a7eaae98ee9f6499af9a97fd095.tar.gz
rneovim-da9005af792f7a7eaae98ee9f6499af9a97fd095.tar.bz2
rneovim-da9005af792f7a7eaae98ee9f6499af9a97fd095.zip
fix(v:lua): fix emsg when calling v:lua directly
v:lua expressions are represented using vvlua_partial. As v:lua isn't intended to be called directly, it's given an empty pt_name. Because of this, calling v:lua directly like "v:lua()" will cause "E117: Unknown function: ", with an empty name. Instead, have call_func() show the name "v:lua" in the emsg.
Diffstat (limited to 'test/functional/lua/luaeval_spec.lua')
-rw-r--r--test/functional/lua/luaeval_spec.lua1
1 files changed, 1 insertions, 0 deletions
diff --git a/test/functional/lua/luaeval_spec.lua b/test/functional/lua/luaeval_spec.lua
index 2ec48777fd..263408ad33 100644
--- a/test/functional/lua/luaeval_spec.lua
+++ b/test/functional/lua/luaeval_spec.lua
@@ -518,6 +518,7 @@ describe('v:lua', function()
eq("Vim:E15: Invalid expression: v:['lua'].foo()", pcall_err(eval, "v:['lua'].foo()"))
eq("Vim(call):E461: Illegal variable name: v:['lua']", pcall_err(command, "call v:['lua'].baar()"))
+ eq("Vim:E117: Unknown function: v:lua", pcall_err(eval, "v:lua()"))
eq("Vim(let):E46: Cannot change read-only variable \"v:['lua']\"", pcall_err(command, "let v:['lua'] = 'xx'"))
eq("Vim(let):E46: Cannot change read-only variable \"v:lua\"", pcall_err(command, "let v:lua = 'xx'"))