0
0
mirror of https://github.com/vim/vim.git synced 2025-09-30 04:44:14 -04:00

patch 7.4.1297

Problem:    On Mac test_channel leaves python instances running.
Solution:   Use a small waittime to make ch_open() work. (Ozaki Kiichi)
This commit is contained in:
Bram Moolenaar
2016-02-09 23:33:25 +01:00
parent f068dcafcf
commit a483326e3b
2 changed files with 6 additions and 3 deletions

View File

@@ -23,6 +23,7 @@ else
endif endif
let s:port = -1 let s:port = -1
let s:chopt = has('macunix') ? {'waittime' : 1} : {}
func s:start_server() func s:start_server()
" The Python program writes the port number in Xportnr. " The Python program writes the port number in Xportnr.
@@ -60,7 +61,7 @@ func s:start_server()
endif endif
let s:port = l[0] let s:port = l[0]
let handle = ch_open('localhost:' . s:port) let handle = ch_open('localhost:' . s:port, s:chopt)
return handle return handle
endfunc endfunc
@@ -155,7 +156,7 @@ func Test_two_channels()
endif endif
call assert_equal('got it', ch_sendexpr(handle, 'hello!')) call assert_equal('got it', ch_sendexpr(handle, 'hello!'))
let newhandle = ch_open('localhost:' . s:port) let newhandle = ch_open('localhost:' . s:port, s:chopt)
call assert_equal('got it', ch_sendexpr(newhandle, 'hello!')) call assert_equal('got it', ch_sendexpr(newhandle, 'hello!'))
call assert_equal('got it', ch_sendexpr(handle, 'hello!')) call assert_equal('got it', ch_sendexpr(handle, 'hello!'))
@@ -181,7 +182,7 @@ endfunc
" Test that trying to connect to a non-existing port fails quickly. " Test that trying to connect to a non-existing port fails quickly.
func Test_connect_waittime() func Test_connect_waittime()
let start = reltime() let start = reltime()
let handle = ch_open('localhost:9876') let handle = ch_open('localhost:9876', s:chopt)
if handle >= 0 if handle >= 0
" Oops, port does exists. " Oops, port does exists.
call ch_close(handle) call ch_close(handle)

View File

@@ -747,6 +747,8 @@ static char *(features[]) =
static int included_patches[] = static int included_patches[] =
{ /* Add new patch number below this line */ { /* Add new patch number below this line */
/**/
1297,
/**/ /**/
1296, 1296,
/**/ /**/