Mercurial > vim
comparison src/testdir/test_channel.vim @ 8031:ece323e2b57f v7.4.1310
commit https://github.com/vim/vim/commit/6463ca229cb9412581419497924c85fcbfc854ab
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat Feb 13 17:04:46 2016 +0100
patch 7.4.1310
Problem: Jobs don't open a channel.
Solution: Create pipes and add them to the channel. Add ch_logfile().
Only Unix for now.
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Sat, 13 Feb 2016 17:15:05 +0100 |
parents | 4fd171e5cedc |
children | 9dea1571b352 |
comparison
equal
deleted
inserted
replaced
8030:05f57db9d8da | 8031:ece323e2b57f |
---|---|
271 " TODO: why is MS-Windows different? | 271 " TODO: why is MS-Windows different? |
272 let elapsed = reltime(start) | 272 let elapsed = reltime(start) |
273 call assert_true(reltimefloat(elapsed) < (has('unix') ? 1.0 : 3.0)) | 273 call assert_true(reltimefloat(elapsed) < (has('unix') ? 1.0 : 3.0)) |
274 endif | 274 endif |
275 endfunc | 275 endfunc |
276 | |
277 func Test_pipe() | |
278 if !has('job') || !has('unix') | |
279 return | |
280 endif | |
281 let job = job_start("python test_channel_pipe.py") | |
282 call assert_equal("run", job_status(job)) | |
283 try | |
284 let handle = job_getchannel(job) | |
285 call ch_sendraw(handle, "echo something\n", 0) | |
286 call assert_equal("something\n", ch_readraw(handle)) | |
287 let reply = ch_sendraw(handle, "quit\n") | |
288 call assert_equal("Goodbye!\n", reply) | |
289 finally | |
290 call job_stop(job) | |
291 endtry | |
292 endfunc |