view src/testdir/test_nested_function.vim @ 10297:c90f4cc9c3fe v8.0.0045

commit https://github.com/vim/vim/commit/bb09ceb95477ecc271854b3fdd8d2776eca66adf Author: Bram Moolenaar <Bram@vim.org> Date: Tue Oct 18 16:27:23 2016 +0200 patch 8.0.0045 Problem: Calling job_stop() right after job_start() does not work. Solution: Block signals while fork is still busy. (Ozaki Kiichi, closes https://github.com/vim/vim/issues/1155)
author Christian Brabandt <cb@256bit.org>
date Tue, 18 Oct 2016 16:30:04 +0200
parents c577c6a2e88b
children 14a82c6433be
line wrap: on
line source

"Tests for nested functions
"
function! NestedFunc()
  fu! Func1()
    let g:text .= 'Func1 '
  endfunction
  call Func1()
  fu! s:func2()
    let g:text .= 's:func2 '
  endfunction
  call s:func2()
  fu! s:_func3()
    let g:text .= 's:_func3 '
  endfunction
  call s:_func3()
  let fn = 'Func4'
  fu! {fn}()
    let g:text .= 'Func4 '
  endfunction
  call {fn}()
  let fn = 'func5'
  fu! s:{fn}()
    let g:text .= 's:func5'
  endfunction
  call s:{fn}()
endfunction

function! Test_nested_functions()
  let g:text = ''
  call NestedFunc()
  call assert_equal('Func1 s:func2 s:_func3 Func4 s:func5', g:text)
endfunction