@@ -189,15 +189,14 @@ func Test_terminal_scrape_123()
189189 call term_wait (1234 )
190190
191191 call term_wait (buf )
192- let g: buf = buf
193192 " On MS-Windows we first get a startup message of two lines, wait for the
194193 " "cls" to happen, after that we have one line with three characters.
195- call WaitFor (' len(term_scrape(g: buf, 1)) == 3' )
194+ call WaitFor ({ - > len (term_scrape (buf , 1 )) == 3 } )
196195 call Check_123 (buf )
197196
198197 " Must still work after the job ended.
199- let g: job = term_getjob (buf )
200- call WaitFor (' job_status(g: job) == "dead"' )
198+ let job = term_getjob (buf )
199+ call WaitFor ({ - > job_status (job) == " dead" } )
201200 call term_wait (buf )
202201 call Check_123 (buf )
203202
@@ -213,17 +212,17 @@ func Test_terminal_scrape_multibyte()
213212 if has (' win32' )
214213 " Run cmd with UTF-8 codepage to make the type command print the expected
215214 " multibyte characters.
216- let g: buf = term_start (" cmd /K chcp 65001" )
217- call term_sendkeys (g: buf , " type Xtext\<CR> " )
218- call term_sendkeys (g: buf , " exit\<CR> " )
219- let g: line = 4
215+ let buf = term_start (" cmd /K chcp 65001" )
216+ call term_sendkeys (buf , " type Xtext\<CR> " )
217+ call term_sendkeys (buf , " exit\<CR> " )
218+ let line = 4
220219 else
221- let g: buf = term_start (" cat Xtext" )
222- let g: line = 1
220+ let buf = term_start (" cat Xtext" )
221+ let line = 1
223222 endif
224223
225- call WaitFor (' len(term_scrape(g: buf, g: line)) >= 7 && term_scrape(g: buf, g: line)[0].chars == "l"' )
226- let l = term_scrape (g: buf , g: line )
224+ call WaitFor ({ - > len (term_scrape (buf , line )) >= 7 && term_scrape (buf , line )[0 ].chars == " l" } )
225+ let l = term_scrape (buf , line )
227226 call assert_true (len (l ) >= 7 )
228227 call assert_equal (' l' , l [0 ].chars)
229228 call assert_equal (' é' , l [1 ].chars)
@@ -235,13 +234,11 @@ func Test_terminal_scrape_multibyte()
235234 call assert_equal (' r' , l [5 ].chars)
236235 call assert_equal (' s' , l [6 ].chars)
237236
238- let g: job = term_getjob (g: buf )
239- call WaitFor (' job_status(g: job) == "dead"' )
240- call term_wait (g: buf )
237+ let job = term_getjob (buf )
238+ call WaitFor ({ - > job_status (job) == " dead" } )
239+ call term_wait (buf )
241240
242- exe g: buf . ' bwipe'
243- unlet g: buf
244- unlet g: line
241+ exe buf . ' bwipe'
245242 call delete (' Xtext' )
246243endfunc
247244
@@ -254,8 +251,8 @@ func Test_terminal_scroll()
254251 endif
255252 let buf = term_start (cmd)
256253
257- let g: job = term_getjob (buf )
258- call WaitFor (' job_status(g: job) == "dead"' )
254+ let job = term_getjob (buf )
255+ call WaitFor ({ - > job_status (job) == " dead" } )
259256 call term_wait (buf )
260257 if has (' win32' )
261258 " TODO: this should not be needed
@@ -483,7 +480,7 @@ func Test_terminal_list_args()
483480endfunction
484481
485482func Test_terminal_noblock ()
486- let g: buf = term_start (&shell )
483+ let buf = term_start (&shell )
487484 if has (' mac' )
488485 " The shell or something else has a problem dealing with more than 1000
489486 " characters at the same time.
@@ -493,26 +490,24 @@ func Test_terminal_noblock()
493490 endif
494491
495492 for c in [' a' ,' b' ,' c' ,' d' ,' e' ,' f' ,' g' ,' h' ,' i' ,' j' ,' k' ]
496- call term_sendkeys (g: buf , ' echo ' . repeat (c , len ) . " \<cr> " )
493+ call term_sendkeys (buf , ' echo ' . repeat (c , len ) . " \<cr> " )
497494 endfor
498- call term_sendkeys (g: buf , " echo done\<cr> " )
495+ call term_sendkeys (buf , " echo done\<cr> " )
499496
500497 " On MS-Windows there is an extra empty line below "done". Find "done" in
501498 " the last-but-one or the last-but-two line.
502- let g: lnum = term_getsize (g: buf )[0 ] - 1
503- call WaitFor (' term_getline(g: buf, g: lnum) =~ "done" || term_getline(g: buf, g: lnum - 1) =~ "done"' , 3000 )
504- let line = term_getline (g: buf , g: lnum )
499+ let lnum = term_getsize (buf )[0 ] - 1
500+ call WaitFor ({ - > term_getline (buf , lnum) = ~ " done" || term_getline (buf , lnum - 1 ) = ~ " done" } , 3000 )
501+ let line = term_getline (buf , lnum)
505502 if line !~ ' done'
506- let line = term_getline (g: buf , g: lnum - 1 )
503+ let line = term_getline (buf , lnum - 1 )
507504 endif
508505 call assert_match (' done' , line )
509506
510- let g: job = term_getjob (g: buf )
511- call Stop_shell_in_terminal (g: buf )
512- call term_wait (g: buf )
513- unlet g: buf
507+ let g: job = term_getjob (buf )
508+ call Stop_shell_in_terminal (buf )
509+ call term_wait (buf )
514510 unlet g: job
515- unlet g: lnum
516511 bwipe
517512endfunc
518513
0 commit comments