Mercurial > vim
diff src/testdir/test_vim9_builtin.vim @ 24808:0bc60e26a2b5 v8.2.2942
patch 8.2.2942: Vim9: error when calling function with too few arguments
Commit: https://github.com/vim/vim/commit/8da6d6db340069b3307e6bce3cdd40441197efce
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat Jun 5 18:15:09 2021 +0200
patch 8.2.2942: Vim9: error when calling function with too few arguments
Problem: Vim9: internal error when calling function with too few arguments
Solution: Check for argument count to be too few. (closes https://github.com/vim/vim/issues/8325)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sat, 05 Jun 2021 18:30:03 +0200 |
parents | b19c8150ee9d |
children | 8fdf839af1f4 |
line wrap: on
line diff
--- a/src/testdir/test_vim9_builtin.vim +++ b/src/testdir/test_vim9_builtin.vim @@ -810,6 +810,15 @@ def Test_map_function_arg() assert_equal(['0:a', '1:b', '2:c'], l) END CheckDefAndScriptSuccess(lines) + + lines =<< trim END + range(3)->map((a, b, c) => a + b + c) + END + CheckDefExecAndScriptFailure(lines, 'E1190: One argument too few') + lines =<< trim END + range(3)->map((a, b, c, d) => a + b + c + d) + END + CheckDefExecAndScriptFailure(lines, 'E1190: 2 arguments too few') enddef def Test_map_item_type()