mirror of
https://github.com/neovim/neovim.git
synced 2024-12-29 14:41:06 -07:00
test: add test for :function followed by <lambda>
This commit is contained in:
parent
0f2ead02c8
commit
71497c164d
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user