Problem: Terminal test for current directory not used on FreeBSD.
Solution: Make it work on FreeBSD. (Ozaki Kiichi, closes #9516) Add
TermWait() inside Run_shell_in_terminal() as a generic solution.
call term_sendkeys(a:buf, "exit\r")
let job = term_getjob(a:buf)
call WaitForAssert({-> assert_equal("dead", job_status(job))})
+ call TermWait(a:buf)
endfunc
" Wrapper around term_wait() to allow more time for re-runs of flaky tests
let string = string({'job': buf->term_getjob()})
call assert_match("{'job': 'process \\d\\+ run'}", string)
+ " On slower systems it may take a bit of time before the shell is ready to
+ " accept keys. This mainly matters when using term_sendkeys() next.
+ call TermWait(buf)
+
return buf
endfunc
call assert_equal('t', m)
call assert_equal('t', mode(1))
call StopShellInTerminal(buf)
- call TermWait(buf)
close!
tunmap <F3>
endif
call assert_fails('set modifiable', 'E946:')
call StopShellInTerminal(buf)
- call TermWait(buf)
call assert_equal('n', mode())
call assert_match('%aF[^\n]*finished]', execute('ls'))
call assert_match('%aF[^\n]*finished]', execute('ls F'))
call assert_equal("", bufname(buf))
call assert_match('\[No Name\]', execute('file'))
call StopShellInTerminal(buf)
- call TermWait(buf)
endfunc
func Test_terminal_TerminalWinOpen()
func Test_terminal_make_change()
let buf = Run_shell_in_terminal({})
call StopShellInTerminal(buf)
- call TermWait(buf)
setlocal modifiable
exe "normal Axxx\<Esc>"
func Test_terminal_split_quit()
let buf = Run_shell_in_terminal({})
- call TermWait(buf)
split
quit!
call TermWait(buf)
call assert_inrange(91, 100, lines)
call StopShellInTerminal(buf)
- call TermWait(buf)
exe buf . 'bwipe'
set termwinscroll&
call delete('Xtext')
let g:job = term_getjob(buf)
call StopShellInTerminal(buf)
- call TermWait(buf)
unlet g:job
bwipe
endfunc
call term_sendkeys(buf, "\r")
call StopShellInTerminal(buf)
- call TermWait(buf)
tunmap 123
tunmap 456
let buf = Run_shell_in_terminal({})
wall
call StopShellInTerminal(buf)
- call TermWait(buf)
exe buf . 'bwipe'
unlet g:job
endfunc
let buf = Run_shell_in_terminal({})
call assert_fails('wqall', 'E948:')
call StopShellInTerminal(buf)
- call TermWait(buf)
exe buf . 'bwipe'
unlet g:job
endfunc
let buf = Run_shell_in_terminal({})
call assert_equal(colors, term_getansicolors(buf))
call StopShellInTerminal(buf)
- call TermWait(buf)
call assert_equal([], term_getansicolors(buf))
exe buf . 'bwipe'
let buf = Run_shell_in_terminal({})
call assert_equal(g:terminal_ansi_colors, term_getansicolors(buf))
call StopShellInTerminal(buf)
- call TermWait(buf)
exe buf . 'bwipe'
unlet g:terminal_ansi_colors
call assert_fails('call term_setansicolors(buf, {})', 'E714:')
call StopShellInTerminal(buf)
- call TermWait(buf)
call assert_equal(0, term_setansicolors(buf, []))
exe buf . 'bwipe'
endfunc
let win = bufwinid(buf)
call assert_equal([winheight(win), winwidth(win)], term_getsize(buf))
call StopShellInTerminal(buf)
- call TermWait(buf)
exe buf . 'bwipe'
set termwinsize=7x0
let win = bufwinid(buf)
call assert_equal([7, winwidth(win)], term_getsize(buf))
call StopShellInTerminal(buf)
- call TermWait(buf)
exe buf . 'bwipe'
set termwinsize=0x33
let win = bufwinid(buf)
call assert_equal([winheight(win), 33], term_getsize(buf))
call StopShellInTerminal(buf)
- call TermWait(buf)
exe buf . 'bwipe'
set termwinsize=
call assert_equal(30, winwidth(win))
call StopShellInTerminal(buf)
- call TermWait(buf)
exe buf . 'bwipe'
set termwinsize=0*0
let win = bufwinid(buf)
call assert_equal([winheight(win), winwidth(win)], term_getsize(buf))
call StopShellInTerminal(buf)
- call TermWait(buf)
exe buf . 'bwipe'
set termwinsize=
call assert_equal(1, winnr('$'))
let buf = Run_shell_in_terminal({'term_finish': 'close'})
call StopShellInTerminal(buf)
- call TermWait(buf)
" closing window wipes out the terminal buffer a with finished job
call WaitForAssert({-> assert_equal(1, winnr('$'))})
call assert_equal('', term_gettty(buf + 1))
call StopShellInTerminal(buf)
- call TermWait(buf)
exe buf . 'bwipe'
endfunc
func Test_terminal_sync_shell_dir()
CheckUnix
" The test always use sh (see src/testdir/unix.vim).
- " However, BSD's sh doesn't seem to play well with OSC 7 escape sequence.
- CheckNotBSD
set asd
" , is
let chars = ",a"
" "," is url-encoded as '%2C'
let chars_url = "%2Ca"
- let tmpfolder = fnamemodify(tempname(),':h').'/'.chars
- let tmpfolder_url = fnamemodify(tempname(),':h').'/'.chars_url
+ let tmpfolder = fnamemodify(tempname(),':h') .. '/' .. chars
+ let tmpfolder_url = fnamemodify(tempname(),':h') .. '/' .. chars_url
call mkdir(tmpfolder, "p")
let buf = Run_shell_in_terminal({})
- call term_sendkeys(buf, "echo -ne $'\\e\]7;file://".tmpfolder_url."\\a'\<CR>")
- "call term_sendkeys(buf, "cd ".tmpfolder."\<CR>")
+ call term_sendkeys(buf, "echo $'\\e\]7;file://" .. tmpfolder_url .. "\\a'\<CR>")
+ "call term_sendkeys(buf, "cd " .. tmpfolder .. "\<CR>")
call TermWait(buf)
if has("mac")
- let expected = "/private".tmpfolder
+ let expected = "/private" .. tmpfolder
else
let expected = tmpfolder
endif
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 4078,
/**/
4077,
/**/