Mercurial > vim
diff src/testdir/test_vimscript.vim @ 12523:881564b89f9b v8.0.1140
patch 8.0.1140: still old style tests
commit https://github.com/vim/vim/commit/bb3e6416f157f68799ccb6070fa2f91df6780e79
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat Sep 23 19:24:46 2017 +0200
patch 8.0.1140: still old style tests
Problem: Still old style tests.
Solution: Convert two tests to new style. (Yegappan Lakshmanan)
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Sat, 23 Sep 2017 19:30:04 +0200 |
parents | 7003f241b6c7 |
children | 33a2277b8d4d |
line wrap: on
line diff
--- a/src/testdir/test_vimscript.vim +++ b/src/testdir/test_vimscript.vim @@ -1421,6 +1421,26 @@ func Test_user_command_with_bang() delcommand Nieuw endfunc +" Test for script-local function +func <SID>DoLast() + call append(line('$'), "last line") +endfunc + +func s:DoNothing() + call append(line('$'), "nothing line") +endfunc + +func Test_script_local_func() + set nocp viminfo+=nviminfo + new + nnoremap <buffer> _x :call <SID>DoNothing()<bar>call <SID>DoLast()<bar>delfunc <SID>DoNothing<bar>delfunc <SID>DoLast<cr> + + normal _x + call assert_equal('nothing line', getline(2)) + call assert_equal('last line', getline(3)) + enew! | close +endfunc + "------------------------------------------------------------------------------- " Modelines {{{1 " vim: ts=8 sw=4 tw=80 fdm=marker