aboutsummaryrefslogtreecommitdiff
path: root/test/functional/vimscript/eval_spec.lua
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2022-10-04 07:54:42 +0800
committerGitHub <noreply@github.com>2022-10-04 07:54:42 +0800
commita93ff5fc696387798c7ba066c11600ae2ce1ce03 (patch)
tree6cb23fdcf7f7a172c7757c244df64c850569f01a /test/functional/vimscript/eval_spec.lua
parent51d379d40d14d35ccb8e4038504d6c0cda9be62c (diff)
parent71497c164db3180bbec539765f987b483662f73f (diff)
downloadrneovim-a93ff5fc696387798c7ba066c11600ae2ce1ce03.tar.gz
rneovim-a93ff5fc696387798c7ba066c11600ae2ce1ce03.tar.bz2
rneovim-a93ff5fc696387798c7ba066c11600ae2ce1ce03.zip
Merge pull request #20467 from zeertzjq/vim-8.2.2316
vim-patch:8.2.2316: Vim9: cannot list a lambda function
Diffstat (limited to 'test/functional/vimscript/eval_spec.lua')
-rw-r--r--test/functional/vimscript/eval_spec.lua14
1 files changed, 14 insertions, 0 deletions
diff --git a/test/functional/vimscript/eval_spec.lua b/test/functional/vimscript/eval_spec.lua
index d4fa7afe89..1fbdedb815 100644
--- a/test/functional/vimscript/eval_spec.lua
+++ b/test/functional/vimscript/eval_spec.lua
@@ -17,6 +17,7 @@ local clear = helpers.clear
local eq = helpers.eq
local exc_exec = helpers.exc_exec
local exec = helpers.exec
+local exec_capture = helpers.exec_capture
local eval = helpers.eval
local command = helpers.command
local write_file = helpers.write_file
@@ -247,3 +248,16 @@ describe("uncaught exception", function()
eq('123', eval('result'))
end)
end)
+
+describe('lambda function', function()
+ before_each(clear)
+
+ it('can be shown using :function followed by <lambda> #20466', function()
+ command('let A = {-> 1}')
+ local num = exec_capture('echo A'):match("function%('<lambda>(%d+)'%)")
+ eq(([[
+ function <lambda>%s(...)
+1 return 1
+ endfunction]]):format(num), exec_capture(('function <lambda>%s'):format(num)))
+ end)
+end)