diff src/testdir/test_terminal.vim @ 18473:0eeaa9a6e4e7 v8.1.2230

patch 8.1.2230: MS-Windows: testing external commands can be improved Commit: https://github.com/vim/vim/commit/077ff436a77f95c69da219af8cd8f553ff4f9ff8 Author: Bram Moolenaar <Bram@vim.org> Date: Mon Oct 28 00:42:21 2019 +0100 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 https://github.com/vim/vim/issues/4928)
author Bram Moolenaar <Bram@vim.org>
date Mon, 28 Oct 2019 00:45:03 +0100
parents 507348b211b4
children 39b0c28fe495
line wrap: on
line diff
--- a/src/testdir/test_terminal.vim
+++ b/src/testdir/test_terminal.vim
@@ -563,11 +563,14 @@ func Test_terminal_finish_open_close()
 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 @@ func Test_terminal_does_not_truncate_las
 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