feat(lua): make =expr print result of expr

This commit is contained in:
shadmansaleh
2022-01-04 11:05:15 +06:00
parent 207307d0fa
commit d44254641f
3 changed files with 26 additions and 3 deletions

View File

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