66
77source shared.vim
88
9- let s: where = 0
10- func Abort (id)
11- call assert_report (' Test timed out at ' . s: where )
12- call FinishTesting ()
13- endfunc
14-
159func Do_test_quotestar_for_macunix ()
1610 if empty (exepath (' pbcopy' )) || empty (exepath (' pbpaste' ))
1711 return ' Test requires pbcopy(1) and pbpaste(1)'
@@ -46,10 +40,6 @@ func Do_test_quotestar_for_x11()
4640 return ' GetVimCommand() failed'
4741 endif
4842
49- " Some of these commands may hang when failing.
50- call timer_start (10000 , ' Abort' )
51-
52- let s: where = 1
5343 let name = ' XVIMCLIPBOARD'
5444 let cmd .= ' --servername ' . name
5545 let g: job = job_start (cmd, {' stoponexit' : ' kill' , ' out_io' : ' null' })
@@ -58,25 +48,19 @@ func Do_test_quotestar_for_x11()
5848 call assert_report (' Cannot run the Vim server' )
5949 return ' '
6050 endif
61- let s: where = 2
6251
6352 " Takes a short while for the server to be active.
6453 call WaitFor (' serverlist() =~ "' . name . ' "' )
6554 call assert_match (name, serverlist ())
66- let s: where = 3
6755
6856 " Clear the *-register of this vim instance.
6957 let @* = ' '
7058
7159 " Try to change the *-register of the server.
7260 call remote_foreground (name)
73- let s: where = 4
7461 call remote_send (name, " :let @* = 'yes'\<CR> " )
75- let s: where = 5
76- call WaitFor (' remote_expr("' . name . ' ", "@*") == "yes"' )
77- let s: where = 6
78- call assert_equal (' yes' , remote_expr (name, " @*" ))
79- let s: where = 7
62+ call WaitFor (' remote_expr("' . name . ' ", "@*", "", 1) == "yes"' )
63+ call assert_equal (' yes' , remote_expr (name, " @*" , " " , 2 ))
8064
8165 " Check that the *-register of this vim instance is changed as expected.
8266 call assert_equal (' yes' , @* )
@@ -94,22 +78,18 @@ func Do_test_quotestar_for_x11()
9478 else
9579 call remote_send (name, " :gui -f\<CR> " )
9680 endif
97- let s: where = 8
98- sleep 500 m
81+ " Wait for the server to be up and answering requests.
82+ call WaitFor (' remote_expr("' . name . ' ", "v:version", "", 1) != ""' )
83+
9984 call remote_send (name, " :let @* = 'maybe'\<CR> " )
100- let s: where = 9
101- call WaitFor (' remote_expr("' . name . ' ", "@*") == "maybe"' )
102- let s: where = 10
103- call assert_equal (' maybe' , remote_expr (name, " @*" ))
104- let s: where = 11
85+ call WaitFor (' remote_expr("' . name . ' ", "@*", "", 1) == "maybe"' )
86+ call assert_equal (' maybe' , remote_expr (name, " @*" , " " , 2 ))
10587
10688 call assert_equal (' maybe' , @* )
10789 endif
10890
10991 call remote_send (name, " :qa!\<CR> " )
110- let s: where = 12
11192 call WaitFor (' job_status(g:job) == "dead"' )
112- let s: where = 13
11393 if job_status (g: job ) != ' dead'
11494 call assert_report (' Server did not exit' )
11595 call job_stop (g: job , ' kill' )
0 commit comments