diff src/testdir/test_channel.vim @ 19360:16d538568dc8 v8.2.0238

patch 8.2.0238: MS-Windows: job_stop() results in exit value zero Commit: https://github.com/vim/vim/commit/b3e195cca7b3201b188c1713b64012b1bef4f61f Author: Bram Moolenaar <Bram@vim.org> Date: Mon Feb 10 21:32:19 2020 +0100 patch 8.2.0238: MS-Windows: job_stop() results in exit value zero Problem: MS-Windows: job_stop() results in exit value zero. Solution: Call TerminateJobObject() with -1 instead of 0. (Yasuhiro Matsumoto, closes #5150, closes #5614)
author Bram Moolenaar <Bram@vim.org>
date Mon, 10 Feb 2020 21:45:03 +0100
parents 2a017e9dc6da
children 7894f20668b1
line wrap: on
line diff
--- a/src/testdir/test_channel.vim
+++ b/src/testdir/test_channel.vim
@@ -1991,3 +1991,18 @@ func Test_job_start_fails()
   " this was leaking memory
   call assert_fails("call job_start([''])", "E474:")
 endfunc
+
+func Test_issue_5150()
+  let g:job = job_start('grep foo', {})
+  call job_stop(g:job)
+  sleep 10m
+  call assert_equal(-1, job_info(g:job).exitval)
+  let g:job = job_start('grep foo', {})
+  call job_stop(g:job, 'term')
+  sleep 10m
+  call assert_equal(-1, job_info(g:job).exitval)
+  let g:job = job_start('grep foo', {})
+  call job_stop(g:job, 'kill')
+  sleep 10m
+  call assert_equal(-1, job_info(g:job).exitval)
+endfunc