Skip to content

Instantly share code, notes, and snippets.

@ichizok
Created February 9, 2016 20:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ichizok/30ae71b0e12b85a1f864 to your computer and use it in GitHub Desktop.
Save ichizok/30ae71b0e12b85a1f864 to your computer and use it in GitHub Desktop.
test_channel.vim on OS X
diff --git a/src/testdir/test_channel.vim b/src/testdir/test_channel.vim
--- a/src/testdir/test_channel.vim
+++ b/src/testdir/test_channel.vim
@@ -23,6 +23,7 @@ else
endif
let s:port = -1
+let s:chopt = has('macunix') ? {'waittime' : 1} : {}
func s:start_server(testfunc)
" The Python program writes the port number in Xportnr.
@@ -90,7 +91,7 @@ func s:RequestHandler(handle, msg)
endfunc
func s:communicate()
- let handle = ch_open('localhost:' . s:port)
+ let handle = ch_open('localhost:' . s:port, s:chopt)
if handle < 0
call assert_false(1, "Can't open channel")
return
@@ -160,7 +161,7 @@ endfunc
" Test that we can open two channels.
func s:two_channels()
- let handle = ch_open('localhost:' . s:port)
+ let handle = ch_open('localhost:' . s:port, s:chopt)
if handle < 0
call assert_false(1, "Can't open channel")
return
@@ -168,7 +169,7 @@ func s:two_channels()
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(handle, 'hello!'))
@@ -184,7 +185,7 @@ endfunc
" Test that a server crash is handled gracefully.
func s:server_crash()
- let handle = ch_open('localhost:' . s:port)
+ let handle = ch_open('localhost:' . s:port, s:chopt)
if handle < 0
call assert_false(1, "Can't open channel")
return
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment