patch 8.1.2230: MS-Windows: testing external commands can be improved
Problem: MS-Windows: testing external commands can be improved.
Solution: Adjust tests, remove duplicate test. (closes #4928)
diff --git a/src/testdir/test_terminal.vim b/src/testdir/test_terminal.vim
index 212a15f..9aae680 100644
--- a/src/testdir/test_terminal.vim
+++ b/src/testdir/test_terminal.vim
@@ -563,11 +563,14 @@
endfunc
func Test_terminal_cwd()
- if !executable('pwd')
- return
+ if has('win32')
+ let cmd = 'cmd /c cd'
+ else
+ CheckExecutable pwd
+ let cmd = 'pwd'
endif
call mkdir('Xdir')
- let buf = term_start('pwd', {'cwd': 'Xdir'})
+ let buf = term_start(cmd, {'cwd': 'Xdir'})
call WaitForAssert({-> assert_equal('Xdir', fnamemodify(getline(1), ":t"))})
exe buf . 'bwipe'
@@ -2031,7 +2034,13 @@
endfunc
func Test_terminal_no_job()
- let term = term_start('false', {'term_finish': 'close'})
+ if has('win32')
+ let cmd = 'cmd /c ""'
+ else
+ CheckExecutable false
+ let cmd = 'false'
+ endif
+ let term = term_start(cmd, {'term_finish': 'close'})
call WaitForAssert({-> assert_equal(v:null, term_getjob(term)) })
endfunc