comparison src/testdir/term_util.vim @ 27098:8bb07c88ac27 v8.2.4078

patch 8.2.4078: terminal test for current directory not used on FreeBSD Commit: https://github.com/vim/vim/commit/ced2b38a560cc4f4ec983ed2cf4372ab62e1dbc1 Author: Bram Moolenaar <Bram@vim.org> Date: Thu Jan 13 15:25:32 2022 +0000 patch 8.2.4078: terminal test for current directory not used on FreeBSD Problem: Terminal test for current directory not used on FreeBSD. Solution: Make it work on FreeBSD. (Ozaki Kiichi, closes https://github.com/vim/vim/issues/9516) Add TermWait() inside Run_shell_in_terminal() as a generic solution.
author Bram Moolenaar <Bram@vim.org>
date Thu, 13 Jan 2022 16:30:04 +0100
parents 3f96a5dc0c53
children fbc4d3b0302d
comparison
equal deleted inserted replaced
27097:6612e555c1c0 27098:8bb07c88ac27
22 " Stops the shell running in terminal "buf". 22 " Stops the shell running in terminal "buf".
23 func StopShellInTerminal(buf) 23 func StopShellInTerminal(buf)
24 call term_sendkeys(a:buf, "exit\r") 24 call term_sendkeys(a:buf, "exit\r")
25 let job = term_getjob(a:buf) 25 let job = term_getjob(a:buf)
26 call WaitForAssert({-> assert_equal("dead", job_status(job))}) 26 call WaitForAssert({-> assert_equal("dead", job_status(job))})
27 call TermWait(a:buf)
27 endfunc 28 endfunc
28 29
29 " Wrapper around term_wait() to allow more time for re-runs of flaky tests 30 " Wrapper around term_wait() to allow more time for re-runs of flaky tests
30 " The second argument is the minimum time to wait in msec, 10 if omitted. 31 " The second argument is the minimum time to wait in msec, 10 if omitted.
31 func TermWait(buf, ...) 32 func TermWait(buf, ...)
174 call assert_equal(v:t_job, type(g:job)) 175 call assert_equal(v:t_job, type(g:job))
175 176
176 let string = string({'job': buf->term_getjob()}) 177 let string = string({'job': buf->term_getjob()})
177 call assert_match("{'job': 'process \\d\\+ run'}", string) 178 call assert_match("{'job': 'process \\d\\+ run'}", string)
178 179
180 " On slower systems it may take a bit of time before the shell is ready to
181 " accept keys. This mainly matters when using term_sendkeys() next.
182 call TermWait(buf)
183
179 return buf 184 return buf
180 endfunc 185 endfunc
181 186
182 " Return concatenated lines in terminal. 187 " Return concatenated lines in terminal.
183 func Term_getlines(buf, lines) 188 func Term_getlines(buf, lines)