@@ -8,10 +8,14 @@ source shared.vim
88
99let s: python = PythonProg ()
1010if s: python == ' '
11- " Can't run this test.
11+ " Can't run this test without Python .
1212 finish
1313endif
1414
15+ " Uncomment the next line to see what happens. Output is in
16+ " src/testdir/channellog.
17+ " call ch_logfile('channellog', 'w')
18+
1519let s: chopt = {}
1620
1721" Run "testfunc" after sarting the server and stop the server afterwards.
@@ -31,7 +35,7 @@ func Ch_communicate(port)
3135 let handle = ch_open (' localhost:' . a: port , s: chopt )
3236 unlet s: chopt .drop
3337 if ch_status (handle) == " fail"
34- call assert_false ( 1 , " Can't open channel" )
38+ call assert_report ( " Can't open channel" )
3539 return
3640 endif
3741 if has (' job' )
@@ -93,7 +97,7 @@ func Ch_communicate(port)
9397 call ch_sendexpr (handle, ' hello!' , {' callback' : ' Ch_requestHandler' })
9498 call WaitFor (' exists("g:Ch_responseHandle")' )
9599 if ! exists (' g:Ch_responseHandle' )
96- call assert_false ( 1 , ' g:Ch_responseHandle was not set' )
100+ call assert_report ( ' g:Ch_responseHandle was not set' )
97101 else
98102 call assert_equal (handle, g: Ch_responseHandle )
99103 unlet g: Ch_responseHandle
@@ -104,7 +108,7 @@ func Ch_communicate(port)
104108 call ch_sendexpr (handle, ' hello!' , {' callback' : function (' Ch_requestHandler' )})
105109 call WaitFor (' exists("g:Ch_responseHandle")' )
106110 if ! exists (' g:Ch_responseHandle' )
107- call assert_false ( 1 , ' g:Ch_responseHandle was not set' )
111+ call assert_report ( ' g:Ch_responseHandle was not set' )
108112 else
109113 call assert_equal (handle, g: Ch_responseHandle )
110114 unlet g: Ch_responseHandle
@@ -116,7 +120,7 @@ func Ch_communicate(port)
116120 call ch_sendexpr (handle, ' hello!' , {' callback' : {a , b - > Ch_requestHandler (a , b )}})
117121 call WaitFor (' exists("g:Ch_responseHandle")' )
118122 if ! exists (' g:Ch_responseHandle' )
119- call assert_false ( 1 , ' g:Ch_responseHandle was not set' )
123+ call assert_report ( ' g:Ch_responseHandle was not set' )
120124 else
121125 call assert_equal (handle, g: Ch_responseHandle )
122126 unlet g: Ch_responseHandle
@@ -209,15 +213,15 @@ func Ch_two_channels(port)
209213 let handle = ch_open (' localhost:' . a: port , s: chopt )
210214 call assert_equal (v: t_channel , type (handle))
211215 if ch_status (handle) == " fail"
212- call assert_false ( 1 , " Can't open channel" )
216+ call assert_report ( " Can't open channel" )
213217 return
214218 endif
215219
216220 call assert_equal (' got it' , ch_evalexpr (handle, ' hello!' ))
217221
218222 let newhandle = ch_open (' localhost:' . a: port , s: chopt )
219223 if ch_status (newhandle) == " fail"
220- call assert_false ( 1 , " Can't open second channel" )
224+ call assert_report ( " Can't open second channel" )
221225 return
222226 endif
223227 call assert_equal (' got it' , ch_evalexpr (newhandle, ' hello!' ))
@@ -238,7 +242,7 @@ endfunc
238242func Ch_server_crash (port)
239243 let handle = ch_open (' localhost:' . a: port , s: chopt )
240244 if ch_status (handle) == " fail"
241- call assert_false ( 1 , " Can't open channel" )
245+ call assert_report ( " Can't open channel" )
242246 return
243247 endif
244248
@@ -263,7 +267,7 @@ endfunc
263267func Ch_channel_handler (port)
264268 let handle = ch_open (' localhost:' . a: port , s: chopt )
265269 if ch_status (handle) == " fail"
266- call assert_false ( 1 , " Can't open channel" )
270+ call assert_report ( " Can't open channel" )
267271 return
268272 endif
269273
@@ -306,7 +310,7 @@ endfunc
306310func Ch_channel_zero (port)
307311 let handle = ch_open (' localhost:' . a: port , s: chopt )
308312 if ch_status (handle) == " fail"
309- call assert_false ( 1 , " Can't open channel" )
313+ call assert_report ( " Can't open channel" )
310314 return
311315 endif
312316
@@ -373,7 +377,7 @@ endfunc
373377func Ch_raw_one_time_callback (port)
374378 let handle = ch_open (' localhost:' . a: port , s: chopt )
375379 if ch_status (handle) == " fail"
376- call assert_false ( 1 , " Can't open channel" )
380+ call assert_report ( " Can't open channel" )
377381 return
378382 endif
379383 call ch_setoptions (handle, {' mode' : ' raw' })
@@ -429,7 +433,7 @@ func Test_connect_waittime()
429433 endif
430434 catch
431435 if v: exception !~ ' Connection reset by peer'
432- call assert_false ( 1 , " Caught exception: " . v: exception )
436+ call assert_report ( " Caught exception: " . v: exception )
433437 endif
434438 endtry
435439endfunc
@@ -1343,7 +1347,7 @@ func Ch_open_delay(port)
13431347 let channel = ch_open (' localhost:' . a: port , s: chopt )
13441348 unlet s: chopt .waittime
13451349 if ch_status (channel) == " fail"
1346- call assert_false ( 1 , " Can't open channel" )
1350+ call assert_report ( " Can't open channel" )
13471351 return
13481352 endif
13491353 call assert_equal (' got it' , ch_evalexpr (channel, ' hello!' ))
@@ -1365,7 +1369,7 @@ endfunc
13651369function Ch_test_call (port)
13661370 let handle = ch_open (' localhost:' . a: port , s: chopt )
13671371 if ch_status (handle) == " fail"
1368- call assert_false ( 1 , " Can't open channel" )
1372+ call assert_report ( " Can't open channel" )
13691373 return
13701374 endif
13711375
@@ -1463,7 +1467,7 @@ endfunc
14631467function Ch_test_close_callback (port)
14641468 let handle = ch_open (' localhost:' . a: port , s: chopt )
14651469 if ch_status (handle) == " fail"
1466- call assert_false ( 1 , " Can't open channel" )
1470+ call assert_report ( " Can't open channel" )
14671471 return
14681472 endif
14691473 call ch_setoptions (handle, {' close_cb' : ' MyCloseCb' })
@@ -1481,7 +1485,7 @@ endfunc
14811485function Ch_test_close_partial (port)
14821486 let handle = ch_open (' localhost:' . a: port , s: chopt )
14831487 if ch_status (handle) == " fail"
1484- call assert_false ( 1 , " Can't open channel" )
1488+ call assert_report ( " Can't open channel" )
14851489 return
14861490 endif
14871491 let g: Ch_d = {}
@@ -1631,7 +1635,7 @@ endfunc
16311635function Ch_test_close_lambda (port)
16321636 let handle = ch_open (' localhost:' . a: port , s: chopt )
16331637 if ch_status (handle) == " fail"
1634- call assert_false ( 1 , " Can't open channel" )
1638+ call assert_report ( " Can't open channel" )
16351639 return
16361640 endif
16371641 let g: Ch_close_ret = ' '
@@ -1646,6 +1650,3 @@ func Test_close_lambda()
16461650 call ch_log (' Test_close_lambda()' )
16471651 call s: run_server (' Ch_test_close_lambda' )
16481652endfunc
1649-
1650- " Uncomment this to see what happens, output is in src/testdir/channellog.
1651- " call ch_logfile('channellog', 'w')
0 commit comments