diff src/testdir/test_channel.vim @ 10297:c90f4cc9c3fe v8.0.0045

commit https://github.com/vim/vim/commit/bb09ceb95477ecc271854b3fdd8d2776eca66adf Author: Bram Moolenaar <Bram@vim.org> Date: Tue Oct 18 16:27:23 2016 +0200 patch 8.0.0045 Problem: Calling job_stop() right after job_start() does not work. Solution: Block signals while fork is still busy. (Ozaki Kiichi, closes https://github.com/vim/vim/issues/1155)
author Christian Brabandt <cb@256bit.org>
date Tue, 18 Oct 2016 16:30:04 +0200
parents c5c15c818bda
children 88331ee68367
line wrap: on
line diff
--- a/src/testdir/test_channel.vim
+++ b/src/testdir/test_channel.vim
@@ -1433,6 +1433,21 @@ func Test_job_start_invalid()
   call assert_fails('call job_start("")', 'E474:')
 endfunc
 
+func Test_job_stop_immediately()
+  if !has('job')
+    return
+  endif
+
+  let job = job_start([s:python, '-c', 'import time;time.sleep(10)'])
+  try
+    call job_stop(job)
+    call WaitFor('"dead" == job_status(job)')
+    call assert_equal('dead', job_status(job))
+  finally
+    call job_stop(job, 'kill')
+  endtry
+endfunc
+
 " This was leaking memory.
 func Test_partial_in_channel_cycle()
   let d = {}