diff options
author | Bram Moolenaar <Bram@vim.org> | 2019-08-14 21:12:05 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2019-08-14 21:12:05 +0200 |
commit | 93344c2d707d9953f351c944e6a237c9916f69a3 (patch) | |
tree | c21ac5e6e744c88462156a3158dfd3c7ef63371c /src/testdir/test_system.vim | |
parent | 6ace95e9810bdfef5392ad89efc9e4ad4606de28 (diff) | |
download | vim-git-93344c2d707d9953f351c944e6a237c9916f69a3.tar.gz |
patch 8.1.1846: inconsistently using GetVimCommand() and v:progpathv8.1.1846
Problem: Inconsistently using GetVimCommand() and v:progpath. (Daniel
Hahler)
Solution: Use GetVimCommand(). (closes #4806)
Diffstat (limited to 'src/testdir/test_system.vim')
-rw-r--r-- | src/testdir/test_system.vim | 28 |
1 files changed, 15 insertions, 13 deletions
diff --git a/src/testdir/test_system.vim b/src/testdir/test_system.vim index f09f509b5..deee51fa1 100644 --- a/src/testdir/test_system.vim +++ b/src/testdir/test_system.vim @@ -1,5 +1,7 @@ " Tests for system() and systemlist() +source shared.vim + func Test_System() if !executable('echo') || !executable('cat') || !executable('wc') return @@ -49,11 +51,11 @@ endfunc func Test_system_exmode() if has('unix') " echo $? only works on Unix - let cmd = ' -es -u NONE -c "source Xscript" +q; echo "result=$?"' + let cmd = ' -es -c "source Xscript" +q; echo "result=$?"' " Need to put this in a script, "catch" isn't found after an unknown " function. call writefile(['try', 'call doesnotexist()', 'catch', 'endtry'], 'Xscript') - let a = system(v:progpath . cmd) + let a = system(GetVimCommand() . cmd) call assert_match('result=0', a) call assert_equal(0, v:shell_error) endif @@ -61,32 +63,32 @@ func Test_system_exmode() " Error before try does set error flag. call writefile(['call nosuchfunction()', 'try', 'call doesnotexist()', 'catch', 'endtry'], 'Xscript') if has('unix') " echo $? only works on Unix - let a = system(v:progpath . cmd) + let a = system(GetVimCommand() . cmd) call assert_notequal('0', a[0]) endif - let cmd = ' -es -u NONE -c "source Xscript" +q' - let a = system(v:progpath . cmd) + let cmd = ' -es -c "source Xscript" +q' + let a = system(GetVimCommand() . cmd) call assert_notequal(0, v:shell_error) call delete('Xscript') if has('unix') " echo $? only works on Unix - let cmd = ' -es -u NONE -c "call doesnotexist()" +q; echo $?' - let a = system(v:progpath. cmd) + let cmd = ' -es -c "call doesnotexist()" +q; echo $?' + let a = system(GetVimCommand() . cmd) call assert_notequal(0, a[0]) endif - let cmd = ' -es -u NONE -c "call doesnotexist()" +q' - let a = system(v:progpath. cmd) + let cmd = ' -es -c "call doesnotexist()" +q' + let a = system(GetVimCommand(). cmd) call assert_notequal(0, v:shell_error) if has('unix') " echo $? only works on Unix - let cmd = ' -es -u NONE -c "call doesnotexist()|let a=1" +q; echo $?' - let a = system(v:progpath. cmd) + let cmd = ' -es -c "call doesnotexist()|let a=1" +q; echo $?' + let a = system(GetVimCommand() . cmd) call assert_notequal(0, a[0]) endif - let cmd = ' -es -u NONE -c "call doesnotexist()|let a=1" +q' - let a = system(v:progpath. cmd) + let cmd = ' -es -c "call doesnotexist()|let a=1" +q' + let a = system(GetVimCommand() . cmd) call assert_notequal(0, v:shell_error) endfunc |