Mercurial > vim
diff src/testdir/shared.vim @ 9806:108b62925cb0 v7.4.2178
commit https://github.com/vim/vim/commit/3a938383396d4ab352bbb4d806938302debdae2c
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun Aug 7 16:36:40 2016 +0200
patch 7.4.2178
Problem: No test for reading from stdin.
Solution: Add a test.
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Sun, 07 Aug 2016 16:45:05 +0200 |
parents | 4ef933b816e7 |
children | 6a28d0c6f929 |
line wrap: on
line diff
--- a/src/testdir/shared.vim +++ b/src/testdir/shared.vim @@ -122,11 +122,15 @@ func WaitFor(expr) endfunc " Run Vim, using the "vimcmd" file and "-u NORC". -" "before" is a list of commands to be executed before loading plugins. -" "after" is a list of commands to be executed after loading plugins. +" "before" is a list of Vim commands to be executed before loading plugins. +" "after" is a list of Vim commands to be executed after loading plugins. " Plugins are not loaded, unless 'loadplugins' is set in "before". " Return 1 if Vim could be executed. func RunVim(before, after, arguments) + call RunVimPiped(a:before, a:after, a:arguments, '') +endfunc + +func RunVimPiped(before, after, arguments, pipecmd) if !filereadable('vimcmd') return 0 endif @@ -145,7 +149,13 @@ func RunVim(before, after, arguments) if cmd !~ '-u NONE' let cmd = cmd . ' -u NONE' endif - exe "silent !" . cmd . args . ' ' . a:arguments + + " With pipecmd we can't set VIMRUNTIME. + if a:pipecmd != '' + let cmd = substitute(cmd, 'VIMRUNTIME=.*VIMRUNTIME;', '', '') + endif + + exe "silent !" . a:pipecmd . cmd . args . ' ' . a:arguments if len(a:before) > 0 call delete('Xbefore.vim')