diff options
author | Bram Moolenaar <Bram@vim.org> | 2021-06-05 18:15:09 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2021-06-05 18:15:09 +0200 |
commit | 8da6d6db340069b3307e6bce3cdd40441197efce (patch) | |
tree | f52aca5f60babf5e0ebf4ff4b47f78322cf6d94e /src/testdir | |
parent | b288ba9f1dd29ba34f236e3099f779d5ab130227 (diff) |
patch 8.2.2942: Vim9: error when calling function with too few argumentsv8.2.2942
Problem: Vim9: internal error when calling function with too few arguments
Solution: Check for argument count to be too few. (closes #8325)
Diffstat (limited to 'src/testdir')
-rw-r--r-- | src/testdir/test_vim9_builtin.vim | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/testdir/test_vim9_builtin.vim b/src/testdir/test_vim9_builtin.vim index 3fa5eb3065..9cae4a34e1 100644 --- 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() |