comparison 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
comparison
equal deleted inserted replaced
10296:5197102a03f8 10297:c90f4cc9c3fe
1431 func Test_job_start_invalid() 1431 func Test_job_start_invalid()
1432 call assert_fails('call job_start($x)', 'E474:') 1432 call assert_fails('call job_start($x)', 'E474:')
1433 call assert_fails('call job_start("")', 'E474:') 1433 call assert_fails('call job_start("")', 'E474:')
1434 endfunc 1434 endfunc
1435 1435
1436 func Test_job_stop_immediately()
1437 if !has('job')
1438 return
1439 endif
1440
1441 let job = job_start([s:python, '-c', 'import time;time.sleep(10)'])
1442 try
1443 call job_stop(job)
1444 call WaitFor('"dead" == job_status(job)')
1445 call assert_equal('dead', job_status(job))
1446 finally
1447 call job_stop(job, 'kill')
1448 endtry
1449 endfunc
1450
1436 " This was leaking memory. 1451 " This was leaking memory.
1437 func Test_partial_in_channel_cycle() 1452 func Test_partial_in_channel_cycle()
1438 let d = {} 1453 let d = {}
1439 let d.a = function('string', [d]) 1454 let d.a = function('string', [d])
1440 try 1455 try