call job_stop(job)
endtry
- let job = job_start(s:python . " test_channel_pipe.py something",
- \ {'out_io': 'null', 'err_io': 'out'})
- call assert_equal("run", job_status(job))
- call job_stop(job)
+ " This causes spurious leak errors with valgrind.
+ if !RunningWithValgrind()
+ let job = job_start(s:python . " test_channel_pipe.py something",
+ \ {'out_io': 'null', 'err_io': 'out'})
+ call assert_equal("run", job_status(job))
+ call job_stop(job)
- let job = job_start(s:python . " test_channel_pipe.py something",
- \ {'in_io': 'null', 'out_io': 'null', 'err_io': 'null'})
- call assert_equal("run", job_status(job))
- call assert_equal('channel fail', string(job_getchannel(job)))
- call assert_equal('fail', ch_status(job))
- call assert_equal('no process', string(test_null_job()))
- call assert_equal('channel fail', string(test_null_channel()))
- call job_stop(job)
+ let job = job_start(s:python . " test_channel_pipe.py something",
+ \ {'in_io': 'null', 'out_io': 'null', 'err_io': 'null'})
+ call assert_equal("run", job_status(job))
+ call assert_equal('channel fail', string(job_getchannel(job)))
+ call assert_equal('fail', ch_status(job))
+ call assert_equal('no process', string(test_null_job()))
+ call assert_equal('channel fail', string(test_null_channel()))
+ call job_stop(job)
+ endif
endfunc
func Test_pipe_to_buffer_raw()
call assert_fails("call job_start('ls',
\ {'err_io' : 'buffer', 'err_buf' : -1})", 'E475:')
+ let cmd = has('win32') ? "cmd /c dir" : "ls"
+
set nomodifiable
- call assert_fails("call job_start('cmd /c dir',
+ call assert_fails("call job_start(cmd,
\ {'out_io' : 'buffer', 'out_buf' :" .. bufnr() .. "})", 'E21:')
- call assert_fails("call job_start('cmd /c dir',
+ call assert_fails("call job_start(cmd,
\ {'err_io' : 'buffer', 'err_buf' :" .. bufnr() .. "})", 'E21:')
set modifiable
- call assert_fails("call job_start('ls', {'in_io' : 'buffer'})", 'E915:')
+ call assert_fails("call job_start(cmd, {'in_io' : 'buffer'})", 'E915:')
edit! XXX
let bnum = bufnr()
enew
- call assert_fails("call job_start('ls',
+ call assert_fails("call job_start(cmd,
\ {'in_io' : 'buffer', 'in_buf' : bnum})", 'E918:')
" Empty job tests
endfunc
func Test_job_stop_immediately()
+ " With valgrind this causes spurious leak reports
+ if RunningWithValgrind()
+ return
+ endif
+
let g:job = job_start([s:python, '-c', 'import time;time.sleep(10)'])
try
eval g:job->job_stop()
END
call writefile(lines, 'Xtest1')
let buf = RunVimInTerminal('--cmd "set rightleft" Xtest1', {})
- call term_wait(buf)
call term_sendkeys(buf, "Go\<C-P>")
call VerifyScreenDump(buf, 'Test_pum_rightleft_01', {'rows': 8})
call term_sendkeys(buf, "\<C-P>\<C-Y>")
- call term_wait(buf)
+ call TermWait(buf, 30)
redraw!
- call assert_match('\s*miv', Screenline(5))
+ call WaitForAssert({-> assert_match('\s*miv', Screenline(5))})
" Test for expanding tabs to spaces in the popup menu
let lines =<< trim END
END
call writefile(lines, 'Xtest2')
call term_sendkeys(buf, "\<Esc>:e! Xtest2\<CR>")
- call term_wait(buf)
+ call TermWait(buf, 30)
call term_sendkeys(buf, "Goone\<C-X>\<C-L>")
- call term_wait(buf)
+ call TermWait(buf, 30)
redraw!
call VerifyScreenDump(buf, 'Test_pum_rightleft_02', {'rows': 7})
call term_sendkeys(buf, "\<C-Y>")
- call term_wait(buf)
+ call TermWait(buf, 30)
redraw!
- call assert_match('\s*eerht eno', Screenline(4))
+ call WaitForAssert({-> assert_match('\s*eerht eno', Screenline(4))})
call StopVimInTerminal(buf)
call delete('Xtest1')
END
call writefile(lines, 'Xtest1')
let buf = RunVimInTerminal('--cmd "set pumheight=2" Xtest1', {})
- call term_wait(buf)
+ call TermWait(buf)
call term_sendkeys(buf, "Go\<C-P>\<C-P>\<C-P>")
call VerifyScreenDump(buf, 'Test_pum_scrollbar_01', {'rows': 7})
call term_sendkeys(buf, "\<C-E>\<Esc>dd")
- call term_wait(buf)
+ call TermWait(buf)
if has('rightleft')
call term_sendkeys(buf, ":set rightleft\<CR>")
- call term_wait(buf)
+ call TermWait(buf)
call term_sendkeys(buf, "Go\<C-P>\<C-P>\<C-P>")
call VerifyScreenDump(buf, 'Test_pum_scrollbar_02', {'rows': 7})
endif