endif
" Takes a short while for the server to be active.
- call WaitFor('serverlist() =~ "' . name . '"')
+ " When using valgrind it takes much longer.
+ call WaitFor('serverlist() =~ "' . name . '"', 5000)
call assert_match(name, serverlist())
call remote_foreground(name)
let g:buf = 0
endfunc
+func Get_cat_123_cmd()
+ if has('win32')
+ return 'cmd /c "cls && color 2 && echo 123"'
+ else
+ call writefile(["\<Esc>[32m123"], 'Xtext')
+ return "cat Xtext"
+ endif
+endfunc
+
func Test_terminal_nasty_cb()
let cmd = Get_cat_123_cmd()
let g:buf = term_start(cmd, {'exit_cb': function('s:Nasty_exit_cb')})
call assert_equal('123', l)
endfunc
-func Get_cat_123_cmd()
- if has('win32')
- return 'cmd /c "cls && color 2 && echo 123"'
- else
- call writefile(["\<Esc>[32m123"], 'Xtext')
- return "cat Xtext"
- endif
-endfunc
-
func Test_terminal_scrape_123()
let cmd = Get_cat_123_cmd()
let buf = term_start(cmd)
call assert_equal(2, winnr('$'))
call assert_equal(4, winheight(0))
bwipe
-
endfunc
func Test_terminal_cwd()
call term_wait(buf)
call WaitFor('len(readfile("Xfile")) > 0')
call assert_match('executing job failed', readfile('Xfile')[0])
+ call WaitFor('!&modified')
call delete('Xfile')
bwipe