diff options
author | Bram Moolenaar <Bram@vim.org> | 2016-08-06 22:31:42 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2016-08-06 22:31:42 +0200 |
commit | 472a0a880a709c027f4b19cfa56c08e78818112d (patch) | |
tree | f8bb4ee29e9a4b0dd7887411fef04a72461a419e /src/testdir/shared.vim | |
parent | 00ff380295338eedb6138ce87590cc6bed102e9d (diff) |
patch 7.4.2172v7.4.2172
Problem: No test for "vim --help".
Solution: Add a test.
Diffstat (limited to 'src/testdir/shared.vim')
-rw-r--r-- | src/testdir/shared.vim | 23 |
1 files changed, 17 insertions, 6 deletions
diff --git a/src/testdir/shared.vim b/src/testdir/shared.vim index 056ecd926b..5985ff9e1c 100644 --- a/src/testdir/shared.vim +++ b/src/testdir/shared.vim @@ -126,21 +126,32 @@ endfunc " "after" is a list of 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) +func RunVim(before, after, arguments) if !filereadable('vimcmd') return 0 endif - call writefile(a:before, 'Xbefore.vim') - call writefile(a:after, 'Xafter.vim') + let args = a:arguments + if len(a:before) > 0 + call writefile(a:before, 'Xbefore.vim') + let args .= ' --cmd "so Xbefore.vim"' + endif + if len(a:after) > 0 + call writefile(a:after, 'Xafter.vim') + let args .= ' -S Xafter.vim' + endif let cmd = readfile('vimcmd')[0] let cmd = substitute(cmd, '-u \f\+', '-u NONE', '') if cmd !~ '-u NONE' let cmd = cmd . ' -u NONE' endif - exe "silent !" . cmd . " --cmd \"so Xbefore.vim\" -S Xafter.vim" + exe "silent !" . cmd . ' ' . args - call delete('Xbefore.vim') - call delete('Xafter.vim') + if len(a:before) > 0 + call delete('Xbefore.vim') + endif + if len(a:after) > 0 + call delete('Xafter.vim') + endif return 1 endfunc |