Mercurial > vim
comparison src/testdir/test_vim9_func.vim @ 23547:7f09cfa9ac4a v8.2.2316
patch 8.2.2316: Vim9: cannot list a lambda function
Commit: https://github.com/vim/vim/commit/b657198cb30765468451d7f68fce49b5b4000c5d
Author: Bram Moolenaar <Bram@vim.org>
Date: Fri Jan 8 22:24:19 2021 +0100
patch 8.2.2316: Vim9: cannot list a lambda function
Problem: Vim9: cannot list a lambda function.
Solution: Support the <lambda>9 notation, like :disassemble. (closes https://github.com/vim/vim/issues/7634)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Fri, 08 Jan 2021 22:30:06 +0100 |
parents | 987fb6e8a376 |
children | f50ee1ae4d9b |
comparison
equal
deleted
inserted
replaced
23546:b3e66d8b2e93 | 23547:7f09cfa9ac4a |
---|---|
1800 | 1800 |
1801 def Test_line_continuation_in_lambda() | 1801 def Test_line_continuation_in_lambda() |
1802 Line_continuation_in_lambda()->assert_equal(['D', 'C', 'B', 'A']) | 1802 Line_continuation_in_lambda()->assert_equal(['D', 'C', 'B', 'A']) |
1803 enddef | 1803 enddef |
1804 | 1804 |
1805 def Test_list_lambda() | |
1806 timer_start(1000, (_) => 0) | |
1807 var body = execute(timer_info()[0].callback | |
1808 ->string() | |
1809 ->substitute("('", ' ', '') | |
1810 ->substitute("')", '', '') | |
1811 ->substitute('function\zs', ' ', '')) | |
1812 assert_match('def <lambda>\d\+(_: any, ...): number\n1 return 0\n enddef', body) | |
1813 enddef | |
1814 | |
1805 func Test_silent_echo() | 1815 func Test_silent_echo() |
1806 CheckScreendump | 1816 CheckScreendump |
1807 | 1817 |
1808 let lines =<< trim END | 1818 let lines =<< trim END |
1809 vim9script | 1819 vim9script |