diff src/testdir/test_channel.vim @ 14905:c1e94bb0f004 v8.1.0464

patch 8.1.0464: MS-Windows: job_info() has cmd without backslashes commit https://github.com/vim/vim/commit/1df2fa47b49dae568af6048b1dce1edbf4eee7e7 Author: Bram Moolenaar <Bram@vim.org> Date: Sun Oct 7 21:36:11 2018 +0200 patch 8.1.0464: MS-Windows: job_info() has cmd without backslashes Problem: MS-Windows: job_info() has cmd without backslashes. (Daniel Hahler) Solution: Use rem_backslash(). (closes #3517, closes #3404)
author Bram Moolenaar <Bram@vim.org>
date Sun, 07 Oct 2018 21:45:04 +0200
parents 71c17b688bc6
children 7ad55ed0a4f3
line wrap: on
line diff
--- a/src/testdir/test_channel.vim
+++ b/src/testdir/test_channel.vim
@@ -1721,6 +1721,22 @@ func Test_read_from_terminated_job()
   call WaitForAssert({-> assert_equal(1, g:linecount)})
 endfunc
 
+func Test_job_start_windows()
+  if !has('job') || !has('win32')
+    return
+  endif
+
+  " Check that backslash in $COMSPEC is handled properly.
+  let g:echostr = ''
+  let cmd = $COMSPEC . ' /c echo 123'
+  let job = job_start(cmd, {'callback': {ch,msg -> execute(":let g:echostr .= msg")}})
+  let info = job_info(job)
+  call assert_equal([$COMSPEC, '/c', 'echo', '123'], info.cmd)
+
+  call WaitForAssert({-> assert_equal("123", g:echostr)})
+  unlet g:echostr
+endfunc
+
 func Test_env()
   if !has('job')
     return