" Tests for the terminal window.
if !has('terminal')
finish
endif
source shared.vim
source screendump.vim
let s:python = PythonProg()
" Open a terminal with a shell, assign the job to g:job and return the buffer
" number.
func Run_shell_in_terminal(options)
if has('win32')
let buf = term_start([&shell,'/k'], a:options)
else
let buf = term_start(&shell, a:options)
endif
let termlist = term_list()
call assert_equal(1, len(termlist))
call assert_equal(buf, termlist[0])
let g:job = term_getjob(buf)
call assert_equal(v:t_job, type(g:job))
let string = string({'job': term_getjob(buf)})
call assert_match("{'job': 'process \\d\\+ run'}", string)
return buf
endfunc
func Test_terminal_basic()
au TerminalOpen * let b:done = 'yes'
let buf = Run_shell_in_terminal({})
if has("unix")
call assert_match('^/dev/', job_info(g:job).tty_out)
call assert_match('^/dev/', term_gettty(''))
else
call assert_match('^\\\\.\\pipe\\', job_info(g:job).tty_out)
call assert_match('^\\\\.\\pipe\\', term_gettty(''))