fix(lua): print multiple return values with =expr (#16933)

This commit is contained in:
Shadman
2022-01-07 00:42:31 +06:00
committed by GitHub
parent d78e46679d
commit 287d3566de
4 changed files with 42 additions and 2 deletions

View File

@@ -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)