@@ -189,15 +189,10 @@ func Test_terminal_scrape_multibyte()
189189 else
190190 let cmd = " cat Xtext"
191191 endif
192- let buf = term_start (cmd)
193-
194- call term_wait (buf )
195- if has (' win32' )
196- " TODO: this should not be needed
197- sleep 100 m
198- endif
192+ let g: buf = term_start (cmd)
199193
200- let l = term_scrape (buf , 1 )
194+ call WaitFor (' term_scrape(g:buf, 1)[0].chars == "l"' )
195+ let l = term_scrape (g: buf , 1 )
201196 call assert_true (len (l ) >= 7 )
202197 call assert_equal (' l' , l [0 ].chars)
203198 call assert_equal (' é' , l [1 ].chars)
@@ -209,11 +204,12 @@ func Test_terminal_scrape_multibyte()
209204 call assert_equal (' r' , l [5 ].chars)
210205 call assert_equal (' s' , l [6 ].chars)
211206
212- let g: job = term_getjob (buf )
207+ let g: job = term_getjob (g: buf )
213208 call WaitFor (' job_status(g:job) == "dead"' )
214- call term_wait (buf )
209+ call term_wait (g: buf )
215210
216- exe buf . ' bwipe'
211+ exe g: buf . ' bwipe'
212+ unlet g: buf
217213 call delete (' Xtext' )
218214endfunc
219215
@@ -409,16 +405,17 @@ func Test_terminal_env()
409405 if ! has (' unix' )
410406 return
411407 endif
412- let buf = Run_shell_in_terminal ({' env' : {' TESTENV' : ' correct' }})
408+ let g: buf = Run_shell_in_terminal ({' env' : {' TESTENV' : ' correct' }})
413409 " Wait for the shell to display a prompt
414- call WaitFor (' term_getline(1) != ""' )
415- call term_sendkeys (buf , " echo $TESTENV\r " )
416- call term_wait (buf )
417- call Stop_shell_in_terminal (buf )
410+ call WaitFor (' term_getline(g:buf, 1) != ""' )
411+ call term_sendkeys (g: buf , " echo $TESTENV\r " )
412+ call term_wait (g: buf )
413+ call Stop_shell_in_terminal (g: buf )
418414 call WaitFor (' getline(2) == "correct"' )
419415 call assert_equal (' correct' , getline (2 ))
420416
421- exe buf . ' bwipe'
417+ exe g: buf . ' bwipe'
418+ unlet g: buf
422419endfunc
423420
424421" must be last, we can't go back from GUI to terminal
0 commit comments