comparison src/testdir/test_channel.vim @ 8798:176647a751d7 v7.4.1687

commit https://github.com/vim/vim/commit/bdf0bda968a53a55149a4c83a10a60c28e431305 Author: Bram Moolenaar <Bram@vim.org> Date: Wed Mar 30 21:06:57 2016 +0200 patch 7.4.1687 Problem: The channel close_cb option does not work. Solution: Use jo_close_partial instead of jo_err_partial. (Damien)
author Christian Brabandt <cb@256bit.org>
date Wed, 30 Mar 2016 22:15:10 +0200
parents f8707ec9efe4
children 03250bc0c63a
comparison
equal deleted inserted replaced
8797:d007d789682a 8798:176647a751d7
1201 func Test_close_callback() 1201 func Test_close_callback()
1202 call ch_log('Test_close_callback()') 1202 call ch_log('Test_close_callback()')
1203 call s:run_server('s:test_close_callback') 1203 call s:run_server('s:test_close_callback')
1204 endfunc 1204 endfunc
1205 1205
1206 function s:test_close_partial(port)
1207 let handle = ch_open('localhost:' . a:port, s:chopt)
1208 if ch_status(handle) == "fail"
1209 call assert_false(1, "Can't open channel")
1210 return
1211 endif
1212 let s:d = {}
1213 func s:d.closeCb(ch) dict
1214 let self.close_ret = 'closed'
1215 endfunc
1216 call ch_setoptions(handle, {'close_cb': s:d.closeCb})
1217
1218 call assert_equal('', ch_evalexpr(handle, 'close me'))
1219 call s:waitFor('"closed" == s:d.close_ret')
1220 call assert_equal('closed', s:d.close_ret)
1221 unlet s:d
1222 endfunc
1223
1224 func Test_close_partial()
1225 call ch_log('Test_close_partial()')
1226 call s:run_server('s:test_close_partial')
1227 endfunc
1228
1206 func Test_job_start_invalid() 1229 func Test_job_start_invalid()
1207 call assert_fails('call job_start($x)', 'E474:') 1230 call assert_fails('call job_start($x)', 'E474:')
1208 call assert_fails('call job_start("")', 'E474:') 1231 call assert_fails('call job_start("")', 'E474:')
1209 endfunc 1232 endfunc
1210 1233