diff src/testdir/test_vim9_builtin.vim @ 23350:9b86957ddd95 v8.2.2218

patch 8.2.2218: Vim9: failure if passing more args to lambda than expected Commit: https://github.com/vim/vim/commit/fc0e8f5c3ef51c86cfa4a51f92b264ef79962b9d Author: Bram Moolenaar <Bram@vim.org> Date: Fri Dec 25 20:24:51 2020 +0100 patch 8.2.2218: Vim9: failure if passing more args to lambda than expected Problem: Vim9: failure if passing more arguments to a lambda than expected. Solution: Only put expected arguments on the stack. (closes https://github.com/vim/vim/issues/7548)
author Bram Moolenaar <Bram@vim.org>
date Fri, 25 Dec 2020 20:30:03 +0100
parents b79cdad3ea2e
children a6b6bcc004f2
line wrap: on
line diff
--- a/src/testdir/test_vim9_builtin.vim
+++ b/src/testdir/test_vim9_builtin.vim
@@ -321,6 +321,11 @@ def Test_filter_return_type()
   res->assert_equal(6)
 enddef
 
+def Test_filter_missing_argument()
+  var dict = {aa: [1], ab: [2], ac: [3], de: [4]}
+  var res = dict->filter({k -> k =~ 'a' && k !~ 'b'})
+  res->assert_equal({aa: [1], ac: [3]})
+enddef
 
 def Test_garbagecollect()
   garbagecollect(true)