comparison src/testdir/test_channel.vim @ 8174:f2286ff0c102 v7.4.1380

commit https://github.com/vim/vim/commit/ee1cffc07a42441924c5353af7fd7ab6e97e5aae Author: Bram Moolenaar <Bram@vim.org> Date: Sun Feb 21 19:14:41 2016 +0100 patch 7.4.1380 Problem: The job exit callback is not implemented. Solution: Add the "exit-cb" option.
author Christian Brabandt <cb@256bit.org>
date Sun, 21 Feb 2016 19:15:04 +0100
parents a0ffb1f3dedc
children b717dae2f26d
comparison
equal deleted inserted replaced
8173:8f9a62af9212 8174:f2286ff0c102
466 466
467 func Test_call() 467 func Test_call()
468 call ch_log('Test_call()') 468 call ch_log('Test_call()')
469 call s:run_server('s:test_call') 469 call s:run_server('s:test_call')
470 endfunc 470 endfunc
471
472 """""""""
473
474 let s:job_ret = 'not yet'
475 function MyExitCb(job, status)
476 let s:job_ret = 'done'
477 endfunc
478
479 function s:test_exit_callback(port)
480 call job_setoptions(s:job, {'exit-cb': 'MyExitCb'})
481 let s:exit_job = s:job
482 endfunc
483
484 func Test_exit_callback()
485 if has('job')
486 call s:run_server('s:test_exit_callback')
487
488 " the job may take a little while to exit
489 sleep 50m
490
491 " calling job_status() triggers the callback
492 call job_status(s:exit_job)
493 call assert_equal('done', s:job_ret)
494 endif
495 endfunc