Mercurial > vim
comparison src/testdir/test_channel.vim @ 7935:3f2e0b62003d v7.4.1263
commit https://github.com/vim/vim/commit/4d919d748e4e435edb135aa5ccf6ee7de9212023
Author: Bram Moolenaar <Bram@vim.org>
Date: Fri Feb 5 22:36:41 2016 +0100
patch 7.4.1263
Problem: ch_open() hangs when the server isn't running.
Solution: Add a timeout. Use a dict to pass arguments. (Yasuhiro Matsumoto)
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Fri, 05 Feb 2016 22:45:06 +0100 |
parents | 1f0743f4f88f |
children | dcc0bd6b1574 |
comparison
equal
deleted
inserted
replaced
7934:1aab88611034 | 7935:3f2e0b62003d |
---|---|
55 call assert_false(1, "Can't start test_channel.py") | 55 call assert_false(1, "Can't start test_channel.py") |
56 return -1 | 56 return -1 |
57 endif | 57 endif |
58 let s:port = l[0] | 58 let s:port = l[0] |
59 | 59 |
60 let handle = ch_open('localhost:' . s:port, 'json') | 60 let handle = ch_open('localhost:' . s:port) |
61 return handle | 61 return handle |
62 endfunc | 62 endfunc |
63 | 63 |
64 func s:kill_server() | 64 func s:kill_server() |
65 if has('win32') | 65 if has('win32') |
126 if handle < 0 | 126 if handle < 0 |
127 return | 127 return |
128 endif | 128 endif |
129 call assert_equal('got it', ch_sendexpr(handle, 'hello!')) | 129 call assert_equal('got it', ch_sendexpr(handle, 'hello!')) |
130 | 130 |
131 let newhandle = ch_open('localhost:' . s:port, 'json') | 131 let newhandle = ch_open('localhost:' . s:port) |
132 call assert_equal('got it', ch_sendexpr(newhandle, 'hello!')) | 132 call assert_equal('got it', ch_sendexpr(newhandle, 'hello!')) |
133 call assert_equal('got it', ch_sendexpr(handle, 'hello!')) | 133 call assert_equal('got it', ch_sendexpr(handle, 'hello!')) |
134 | 134 |
135 call ch_close(handle) | 135 call ch_close(handle) |
136 call assert_equal('got it', ch_sendexpr(newhandle, 'hello!')) | 136 call assert_equal('got it', ch_sendexpr(newhandle, 'hello!')) |