func StopShellInTerminal(buf)
call term_sendkeys(a:buf, "exit\r")
let job = term_getjob(a:buf)
- call WaitFor({-> job_status(job) == "dead"})
+ call WaitForAssert({-> assert_equal("dead", job_status(job))})
endfunc
" Wrapper around term_wait() to allow more time for re-runs of flaky tests
" number.
func Run_shell_in_terminal(options)
if has('win32')
- let buf = term_start([&shell,'/k'], a:options)
+ let buf = term_start([&shell, '/k'], a:options)
else
let buf = term_start(&shell, a:options)
endif
func Test_mksession_terminal_no_restore_funcarg()
CheckFeature terminal
- call term_start(&shell, {'norestore': 1})
+ let buf = Run_shell_in_terminal({'norestore': 1})
mksession! Xtest_mks.out
let lines = readfile('Xtest_mks.out')
let term_cmd = ''
endif
endfor
- call StopShellInTerminal(bufnr('%'))
+ call StopShellInTerminal(buf)
call delete('Xtest_mks.out')
endfunc