aboutsummaryrefslogtreecommitdiff
path: root/test/functional/lua/commands_spec.lua
diff options
context:
space:
mode:
authorBjörn Linse <bjorn.linse@gmail.com>2022-01-04 14:34:42 +0100
committerGitHub <noreply@github.com>2022-01-04 14:34:42 +0100
commite79a5889378cbcaf8990ced4b852408284fb7c2a (patch)
treea48ea400721dcf3d9a61ef73850472a8dfe13aa6 /test/functional/lua/commands_spec.lua
parent207307d0faf9b821cfd3cfeae4d027ab9ee5dbdb (diff)
parentd44254641ffb5c9f185db4082d2bf1f04bf1117e (diff)
downloadrneovim-e79a5889378cbcaf8990ced4b852408284fb7c2a.tar.gz
rneovim-e79a5889378cbcaf8990ced4b852408284fb7c2a.tar.bz2
rneovim-e79a5889378cbcaf8990ced4b852408284fb7c2a.zip
Merge pull request #16912 from shadmansaleh/enhance/lua_cmd_inspect
feat(lua): make :lua =expr print result of expr
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 9b9ba531b0..b3c3f937ac 100644
--- a/test/functional/lua/commands_spec.lua
+++ b/test/functional/lua/commands_spec.lua
@@ -141,6 +141,15 @@ describe(':lua command', function()
{4:Press ENTER or type command to continue}^ |
]]}
end)
+
+ it('Can print results of =expr', function()
+ helpers.exec_lua("x = 5")
+ eq("5", helpers.exec_capture(':lua =x'))
+ helpers.exec_lua("function x() return 'hello' end")
+ 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'))
+ end)
end)
describe(':luado command', function()