@@ -104,6 +104,15 @@ func! s:Nasty_exit_cb(job, st)
104104 let g: buf = 0
105105endfunc
106106
107+ func Get_cat_123_cmd ()
108+ if has (' win32' )
109+ return ' cmd /c "cls && color 2 && echo 123"'
110+ else
111+ call writefile ([" \<Esc> [32m123" ], ' Xtext' )
112+ return " cat Xtext"
113+ endif
114+ endfunc
115+
107116func Test_terminal_nasty_cb ()
108117 let cmd = Get_cat_123_cmd ()
109118 let g: buf = term_start (cmd, {' exit_cb' : function (' s:Nasty_exit_cb' )})
@@ -143,15 +152,6 @@ func Check_123(buf)
143152 call assert_equal (' 123' , l )
144153endfunc
145154
146- func Get_cat_123_cmd ()
147- if has (' win32' )
148- return ' cmd /c "cls && color 2 && echo 123"'
149- else
150- call writefile ([" \<Esc> [32m123" ], ' Xtext' )
151- return " cat Xtext"
152- endif
153- endfunc
154-
155155func Test_terminal_scrape_123 ()
156156 let cmd = Get_cat_123_cmd ()
157157 let buf = term_start (cmd)
@@ -393,7 +393,6 @@ func Test_finish_open_close()
393393 call assert_equal (2 , winnr (' $' ))
394394 call assert_equal (4 , winheight (0 ))
395395 bwipe
396-
397396endfunc
398397
399398func Test_terminal_cwd ()
@@ -613,6 +612,7 @@ func Test_terminal_redir_file()
613612 call term_wait (buf )
614613 call WaitFor (' len(readfile("Xfile")) > 0' )
615614 call assert_match (' executing job failed' , readfile (' Xfile' )[0 ])
615+ call WaitFor (' !&modified' )
616616 call delete (' Xfile' )
617617 bwipe
618618
0 commit comments