mirror of
https://github.com/vim/vim.git
synced 2025-07-26 11:04:33 -04:00
patch 7.4.2178
Problem: No test for reading from stdin. Solution: Add a test.
This commit is contained in:
parent
ba98bef191
commit
3a93838339
@ -122,11 +122,15 @@ func WaitFor(expr)
|
|||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
" Run Vim, using the "vimcmd" file and "-u NORC".
|
" Run Vim, using the "vimcmd" file and "-u NORC".
|
||||||
" "before" is a list of commands to be executed before loading plugins.
|
" "before" is a list of Vim commands to be executed before loading plugins.
|
||||||
" "after" is a list of commands to be executed after 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".
|
" Plugins are not loaded, unless 'loadplugins' is set in "before".
|
||||||
" Return 1 if Vim could be executed.
|
" Return 1 if Vim could be executed.
|
||||||
func RunVim(before, after, arguments)
|
func RunVim(before, after, arguments)
|
||||||
|
call RunVimPiped(a:before, a:after, a:arguments, '')
|
||||||
|
endfunc
|
||||||
|
|
||||||
|
func RunVimPiped(before, after, arguments, pipecmd)
|
||||||
if !filereadable('vimcmd')
|
if !filereadable('vimcmd')
|
||||||
return 0
|
return 0
|
||||||
endif
|
endif
|
||||||
@ -145,7 +149,13 @@ func RunVim(before, after, arguments)
|
|||||||
if cmd !~ '-u NONE'
|
if cmd !~ '-u NONE'
|
||||||
let cmd = cmd . ' -u NONE'
|
let cmd = cmd . ' -u NONE'
|
||||||
endif
|
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
|
if len(a:before) > 0
|
||||||
call delete('Xbefore.vim')
|
call delete('Xbefore.vim')
|
||||||
|
@ -169,3 +169,15 @@ func Test_startuptime()
|
|||||||
endif
|
endif
|
||||||
call delete('Xtestout')
|
call delete('Xtestout')
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
|
func Test_read_stdin()
|
||||||
|
let after = [
|
||||||
|
\ 'write Xtestout',
|
||||||
|
\ 'quit!',
|
||||||
|
\ ]
|
||||||
|
if RunVimPiped([], after, '-', 'echo something | ')
|
||||||
|
let lines = readfile('Xtestout')
|
||||||
|
call assert_equal('something', lines[0])
|
||||||
|
endif
|
||||||
|
call delete('Xtestout')
|
||||||
|
endfunc
|
||||||
|
@ -763,6 +763,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
2178,
|
||||||
/**/
|
/**/
|
||||||
2177,
|
2177,
|
||||||
/**/
|
/**/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user