comparison src/testdir/test_channel.vim @ 8380:892d7dcf17ec v7.4.1482

commit https://github.com/vim/vim/commit/da94fdf2588b3910d38e477a755748ce2c6d2e66 Author: Bram Moolenaar <Bram@vim.org> Date: Thu Mar 3 18:09:10 2016 +0100 patch 7.4.1482 Problem: "timeout" option not supported on ch_send*() and ch_eval*(). Solution: Get and use the timeout option from the argument.
author Christian Brabandt <cb@256bit.org>
date Thu, 03 Mar 2016 18:15:05 +0100
parents 8fa75a4c39bd
children 3dbe93a240d8
comparison
equal deleted inserted replaced
8379:c63196126179 8380:892d7dcf17ec
118 call assert_equal('ok', ch_evalexpr(handle, 'make change')) 118 call assert_equal('ok', ch_evalexpr(handle, 'make change'))
119 sleep 10m 119 sleep 10m
120 call assert_equal('added1', getline(line('$') - 1)) 120 call assert_equal('added1', getline(line('$') - 1))
121 call assert_equal('added2', getline('$')) 121 call assert_equal('added2', getline('$'))
122 122
123 call assert_equal('ok', ch_evalexpr(handle, 'do normal')) 123 call assert_equal('ok', ch_evalexpr(handle, 'do normal', {'timeout': 100}))
124 sleep 10m 124 sleep 10m
125 call assert_equal('added more', getline('$')) 125 call assert_equal('added more', getline('$'))
126 126
127 " Send a request with a specific handler. 127 " Send a request with a specific handler.
128 call ch_sendexpr(handle, 'hello!', {'callback': 's:RequestHandler'}) 128 call ch_sendexpr(handle, 'hello!', {'callback': 's:RequestHandler'})
340 340
341 call ch_sendraw(handle, "double this\n") 341 call ch_sendraw(handle, "double this\n")
342 let msg = ch_readraw(handle) 342 let msg = ch_readraw(handle)
343 call assert_equal("this\nAND this\n", substitute(msg, "\r", "", 'g')) 343 call assert_equal("this\nAND this\n", substitute(msg, "\r", "", 'g'))
344 344
345 let reply = ch_evalraw(handle, "quit\n") 345 let reply = ch_evalraw(handle, "quit\n", {'timeout': 100})
346 call assert_equal("Goodbye!\n", substitute(reply, "\r", "", 'g')) 346 call assert_equal("Goodbye!\n", substitute(reply, "\r", "", 'g'))
347 finally 347 finally
348 call job_stop(job) 348 call job_stop(job)
349 endtry 349 endtry
350 endfunc 350 endfunc