diff src/testdir/test_vim9_func.vim @ 23559:64dfb69e7d46 v8.2.2322

patch 8.2.2322: Vim9: closure nested limiting to one level Commit: https://github.com/vim/vim/commit/0186e58639b19933d3d9188d552fe6745265eb1b Author: Bram Moolenaar <Bram@vim.org> Date: Sun Jan 10 18:33:11 2021 +0100 patch 8.2.2322: Vim9: closure nested limiting to one level Problem: Vim9: closure nested limiting to one level. Solution: Add outer_T. Also make STOREOUTER work.
author Bram Moolenaar <Bram@vim.org>
date Sun, 10 Jan 2021 18:45:04 +0100
parents f50ee1ae4d9b
children 34aa2907082a
line wrap: on
line diff
--- a/src/testdir/test_vim9_func.vim
+++ b/src/testdir/test_vim9_func.vim
@@ -1822,6 +1822,13 @@ def Test_nested_closure_using_argument()
   assert_equal(['x', 'x2'], DoFilterThis('x'))
 enddef
 
+def Test_triple_nested_closure()
+  var what = 'x'
+  var Match = (val: string, cmp: string): bool => stridx(val, cmp) == 0
+  var Filter = (l) => filter(l, (_, v) => Match(v, what))
+  assert_equal(['x', 'x2'], ['x', 'y', 'a', 'x2', 'c']->Filter())
+enddef
+
 func Test_silent_echo()
   CheckScreendump