diff options
Diffstat (limited to 'src/testdir/test_vim9_func.vim')
-rw-r--r-- | src/testdir/test_vim9_func.vim | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/testdir/test_vim9_func.vim b/src/testdir/test_vim9_func.vim index f3352453fe..c3687cf20a 100644 --- a/src/testdir/test_vim9_func.vim +++ b/src/testdir/test_vim9_func.vim @@ -1388,6 +1388,20 @@ def Test_double_closure_fails() CheckScriptSuccess(lines) enddef +def Test_nested_closure_used() + var lines =<< trim END + vim9script + def Func() + var x = 'hello' + var Closure = {-> x} + g:Myclosure = {-> Closure()} + enddef + Func() + assert_equal('hello', g:Myclosure()) + END + CheckScriptSuccess(lines) +enddef + def Test_nested_closure_fails() var lines =<< trim END vim9script |