aboutsummaryrefslogtreecommitdiff
path: root/test/functional/lua/commands_spec.lua
diff options
context:
space:
mode:
authorShadman <13149513+shadmansaleh@users.noreply.github.com>2022-01-07 00:42:31 +0600
committerGitHub <noreply@github.com>2022-01-06 11:42:31 -0700
commit287d3566de11f82aa86448998fd4703b1db328bd (patch)
tree9fd586e31fc9058f499a4247c1c0efe72a64f55d /test/functional/lua/commands_spec.lua
parentd78e46679d2ff31916091f9368367ccc1539c299 (diff)
downloadrneovim-287d3566de11f82aa86448998fd4703b1db328bd.tar.gz
rneovim-287d3566de11f82aa86448998fd4703b1db328bd.tar.bz2
rneovim-287d3566de11f82aa86448998fd4703b1db328bd.zip
fix(lua): print multiple return values with =expr (#16933)
Diffstat (limited to 'test/functional/lua/commands_spec.lua')
-rw-r--r--test/functional/lua/commands_spec.lua9
1 files changed, 9 insertions, 0 deletions
diff --git a/test/functional/lua/commands_spec.lua b/test/functional/lua/commands_spec.lua
index b3c3f937ac..b8346df290 100644
--- a/test/functional/lua/commands_spec.lua
+++ b/test/functional/lua/commands_spec.lua
@@ -149,6 +149,15 @@ describe(':lua command', function()
eq([["hello"]], helpers.exec_capture(':lua = x()'))
helpers.exec_lua("x = {a = 1, b = 2}")
eq("{\n a = 1,\n b = 2\n}", helpers.exec_capture(':lua =x'))
+ helpers.exec_lua([[function x(success)
+ if success then
+ return true, "Return value"
+ else
+ return false, nil, "Error message"
+ end
+ end]])
+ eq([[true "Return value"]], helpers.exec_capture(':lua =x(true)'))
+ eq([[false nil "Error message"]], helpers.exec_capture(':lua =x(false)'))
end)
end)