1"Tests for nested functions 2" 3function! NestedFunc() 4 fu! Func1() 5 let g:text .= 'Func1 ' 6 endfunction 7 call Func1() 8 fu! s:func2() 9 let g:text .= 's:func2 ' 10 endfunction 11 call s:func2() 12 fu! s:_func3() 13 let g:text .= 's:_func3 ' 14 endfunction 15 call s:_func3() 16 let fn = 'Func4' 17 fu! {fn}() 18 let g:text .= 'Func4 ' 19 endfunction 20 call {fn}() 21 let fn = 'func5' 22 fu! s:{fn}() 23 let g:text .= 's:func5' 24 endfunction 25 call s:{fn}() 26endfunction 27 28function! Test_nested_functions() 29 let g:text = '' 30 call NestedFunc() 31 call assert_equal('Func1 s:func2 s:_func3 Func4 s:func5', g:text) 32endfunction 33