summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2019-08-14 21:12:05 +0200
committerBram Moolenaar <Bram@vim.org>2019-08-14 21:12:05 +0200
commit93344c2d707d9953f351c944e6a237c9916f69a3 (patch)
treec21ac5e6e744c88462156a3158dfd3c7ef63371c
parent6ace95e9810bdfef5392ad89efc9e4ad4606de28 (diff)
downloadvim-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)
-rw-r--r--src/testdir/test_autocmd.vim6
-rw-r--r--src/testdir/test_gui.vim5
-rw-r--r--src/testdir/test_normal.vim8
-rw-r--r--src/testdir/test_profile.vim28
-rw-r--r--src/testdir/test_suspend.vim4
-rw-r--r--src/testdir/test_system.vim28
-rw-r--r--src/testdir/test_vimscript.vim3
-rw-r--r--src/version.c2
8 files changed, 45 insertions, 39 deletions
diff --git a/src/testdir/test_autocmd.vim b/src/testdir/test_autocmd.vim
index 5bb601e2d..9dc578e45 100644
--- a/src/testdir/test_autocmd.vim
+++ b/src/testdir/test_autocmd.vim
@@ -439,7 +439,7 @@ func Test_autocmd_bufwipe_in_SessLoadPost()
[CODE]
call writefile(content, 'Xvimrc')
- call system(v:progpath. ' -u Xvimrc --not-a-term --noplugins -S Session.vim -c cq')
+ call system(GetVimCommand('Xvimrc') .. ' --not-a-term --noplugins -S Session.vim -c cq')
let errors = join(readfile('Xerrors'))
call assert_match('E814', errors)
@@ -479,7 +479,7 @@ func Test_autocmd_bufwipe_in_SessLoadPost2()
[CODE]
call writefile(content, 'Xvimrc')
- call system(v:progpath. ' -u Xvimrc --not-a-term --noplugins -S Session.vim -c cq')
+ call system(GetVimCommand('Xvimrc') .. ' --not-a-term --noplugins -S Session.vim -c cq')
let errors = join(readfile('Xerrors'))
" This probably only ever matches on unix.
call assert_notmatch('Caught deadly signal SEGV', errors)
@@ -1422,7 +1422,7 @@ func Test_bufunload_all()
call writefile(content, 'Xtest')
call delete('Xout')
- call system(v:progpath. ' --clean -N --not-a-term -S Xtest')
+ call system(GetVimCommandClean() .. ' -N --not-a-term -S Xtest')
call assert_true(filereadable('Xout'))
call delete('Xxx1')
diff --git a/src/testdir/test_gui.vim b/src/testdir/test_gui.vim
index 985bbf4b7..e80e85f27 100644
--- a/src/testdir/test_gui.vim
+++ b/src/testdir/test_gui.vim
@@ -127,10 +127,9 @@ func Test_quoteplus()
let test_call = 'Can you hear me?'
let test_response = 'Yes, I can.'
- let vim_exe = exepath(v:progpath)
+ let vim_exe = GetVimCommand()
let testee = 'VIMRUNTIME=' . $VIMRUNTIME . '; export VIMRUNTIME;'
- \ . vim_exe
- \ . ' -u NONE -U NONE --noplugin --not-a-term -c ''%s'''
+ \ . vim_exe . ' --noplugin --not-a-term -c ''%s'''
" Ignore the "failed to create input context" error.
let cmd = 'call test_ignore_error("E285") | '
\ . 'gui -f | '
diff --git a/src/testdir/test_normal.vim b/src/testdir/test_normal.vim
index 2df0fe590..c6df1834a 100644
--- a/src/testdir/test_normal.vim
+++ b/src/testdir/test_normal.vim
@@ -1096,7 +1096,7 @@ func Test_normal20_exmode()
endif
call writefile(['1a', 'foo', 'bar', '.', 'w! Xfile2', 'q!'], 'Xscript')
call writefile(['1', '2'], 'Xfile')
- call system(v:progpath .' -e -s < Xscript Xfile')
+ call system(GetVimCommand() .. ' -e -s < Xscript Xfile')
let a=readfile('Xfile2')
call assert_equal(['1', 'foo', 'bar', '2'], a)
@@ -1143,13 +1143,13 @@ func Test_normal22_zet()
" let shell = &shell
" let &shell = 'sh'
call writefile(['1', '2'], 'Xfile')
- let args = ' -u NONE -N -U NONE -i NONE --noplugins -X --not-a-term'
- call system(v:progpath . args . ' -c "%d" -c ":norm! ZZ" Xfile')
+ let args = ' -N -i NONE --noplugins -X --not-a-term'
+ call system(GetVimCommand() .. args .. ' -c "%d" -c ":norm! ZZ" Xfile')
let a = readfile('Xfile')
call assert_equal([], a)
" Test for ZQ
call writefile(['1', '2'], 'Xfile')
- call system(v:progpath . args . ' -c "%d" -c ":norm! ZQ" Xfile')
+ call system(GetVimCommand() . args . ' -c "%d" -c ":norm! ZQ" Xfile')
let a = readfile('Xfile')
call assert_equal(['1', '2'], a)
diff --git a/src/testdir/test_profile.vim b/src/testdir/test_profile.vim
index dbba8002e..c7f515a89 100644
--- a/src/testdir/test_profile.vim
+++ b/src/testdir/test_profile.vim
@@ -3,6 +3,8 @@
source check.vim
CheckFeature profile
+source shared.vim
+
func Test_profile_func()
let lines =<< trim [CODE]
profile start Xprofile_func.log
@@ -34,7 +36,7 @@ func Test_profile_func()
[CODE]
call writefile(lines, 'Xprofile_func.vim')
- call system(v:progpath
+ call system(GetVimCommand()
\ . ' -es --clean'
\ . ' -c "so Xprofile_func.vim"'
\ . ' -c "qall!"')
@@ -120,8 +122,8 @@ func Test_profile_func_with_ifelse()
[CODE]
call writefile(lines, 'Xprofile_func.vim')
- call system(v:progpath
- \ . ' -es -u NONE -U NONE -i NONE --noplugin'
+ call system(GetVimCommand()
+ \ . ' -es -i NONE --noplugin'
\ . ' -c "profile start Xprofile_func.log"'
\ . ' -c "profile func Foo*"'
\ . ' -c "so Xprofile_func.vim"'
@@ -233,8 +235,8 @@ func Test_profile_func_with_trycatch()
[CODE]
call writefile(lines, 'Xprofile_func.vim')
- call system(v:progpath
- \ . ' -es -u NONE -U NONE -i NONE --noplugin'
+ call system(GetVimCommand()
+ \ . ' -es -i NONE --noplugin'
\ . ' -c "profile start Xprofile_func.log"'
\ . ' -c "profile func Foo*"'
\ . ' -c "so Xprofile_func.vim"'
@@ -320,8 +322,8 @@ func Test_profile_file()
[CODE]
call writefile(lines, 'Xprofile_file.vim')
- call system(v:progpath
- \ . ' -es --clean'
+ call system(GetVimCommandClean()
+ \ . ' -es'
\ . ' -c "profile start Xprofile_file.log"'
\ . ' -c "profile file Xprofile_file.vim"'
\ . ' -c "so Xprofile_file.vim"'
@@ -365,8 +367,8 @@ func Test_profile_file_with_cont()
\ ]
call writefile(lines, 'Xprofile_file.vim')
- call system(v:progpath
- \ . ' -es --clean'
+ call system(GetVimCommandClean()
+ \ . ' -es'
\ . ' -c "profile start Xprofile_file.log"'
\ . ' -c "profile file Xprofile_file.vim"'
\ . ' -c "so Xprofile_file.vim"'
@@ -423,8 +425,8 @@ func Test_profile_truncate_mbyte()
\ ]
call writefile(lines, 'Xprofile_file.vim')
- call system(v:progpath
- \ . ' -es --clean --cmd "set enc=utf-8"'
+ call system(GetVimCommandClean()
+ \ . ' -es --cmd "set enc=utf-8"'
\ . ' -c "profile start Xprofile_file.log"'
\ . ' -c "profile file Xprofile_file.vim"'
\ . ' -c "so Xprofile_file.vim"'
@@ -470,7 +472,7 @@ func Test_profdel_func()
call Foo3()
[CODE]
call writefile(lines, 'Xprofile_file.vim')
- call system(v:progpath . ' -es --clean -c "so Xprofile_file.vim" -c q')
+ call system(GetVimCommandClean() . ' -es -c "so Xprofile_file.vim" -c q')
call assert_equal(0, v:shell_error)
let lines = readfile('Xprofile_file.log')
@@ -505,7 +507,7 @@ func Test_profdel_star()
call Foo()
[CODE]
call writefile(lines, 'Xprofile_file.vim')
- call system(v:progpath . ' -es --clean -c "so Xprofile_file.vim" -c q')
+ call system(GetVimCommandClean() . ' -es -c "so Xprofile_file.vim" -c q')
call assert_equal(0, v:shell_error)
let lines = readfile('Xprofile_file.log')
diff --git a/src/testdir/test_suspend.vim b/src/testdir/test_suspend.vim
index 4b3bd5ead..bf88bd445 100644
--- a/src/testdir/test_suspend.vim
+++ b/src/testdir/test_suspend.vim
@@ -26,8 +26,8 @@ func Test_suspend()
" Wait for shell prompt.
call WaitForAssert({-> assert_match('[$#] $', term_getline(buf, '.'))})
- call term_sendkeys(buf, v:progpath
- \ . " --clean -X"
+ call term_sendkeys(buf, GetVimCommandClean()
+ \ . " -X"
\ . " -c 'set nu'"
\ . " -c 'call setline(1, \"foo\")'"
\ . " Xfoo\<CR>")
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
diff --git a/src/testdir/test_vimscript.vim b/src/testdir/test_vimscript.vim
index cf2c961be..69a2ebafd 100644
--- a/src/testdir/test_vimscript.vim
+++ b/src/testdir/test_vimscript.vim
@@ -2,6 +2,7 @@
" Most of this was formerly in test49.
source check.vim
+source shared.vim
"-------------------------------------------------------------------------------
" Test environment {{{1
@@ -1721,7 +1722,7 @@ func Test_function_defined_line()
[CODE]
call writefile(lines, 'Xtest.vim')
- let res = system(v:progpath .. ' --clean -es -X -S Xtest.vim')
+ let res = system(GetVimCommandClean() .. ' -es -X -S Xtest.vim')
call assert_equal(0, v:shell_error)
let m = matchstr(res, 'function F1()[^[:print:]]*[[:print:]]*')
diff --git a/src/version.c b/src/version.c
index 71f6c34f3..53982c58b 100644
--- a/src/version.c
+++ b/src/version.c
@@ -770,6 +770,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 1846,
+/**/
1845,
/**/
1844,