mirror of
https://github.com/neovim/neovim.git
synced 2025-09-06 19:38:20 +00:00
Merge pull request #21292 from zeertzjq/vim-8.2.1195
vim-patch:8.2.{1195,1197,2240,3108,3109,3495,3499,3526,5145}
This commit is contained in:
@@ -123,6 +123,14 @@ func CheckCanRunGui()
|
|||||||
endif
|
endif
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
|
" Command to Check for an environment variable
|
||||||
|
command -nargs=1 CheckEnv call CheckEnv(<f-args>)
|
||||||
|
func CheckEnv(name)
|
||||||
|
if empty(eval('$' .. a:name))
|
||||||
|
throw 'Skipped: Environment variable ' .. a:name .. ' is not set'
|
||||||
|
endif
|
||||||
|
endfunc
|
||||||
|
|
||||||
" Command to check that we are using the GUI
|
" Command to check that we are using the GUI
|
||||||
command CheckGui call CheckGui()
|
command CheckGui call CheckGui()
|
||||||
func CheckGui()
|
func CheckGui()
|
||||||
@@ -163,6 +171,22 @@ func CheckNotAsan()
|
|||||||
endif
|
endif
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
|
" Command to check for not running under valgrind
|
||||||
|
command CheckNotValgrind call CheckNotValgrind()
|
||||||
|
func CheckNotValgrind()
|
||||||
|
if RunningWithValgrind()
|
||||||
|
throw 'Skipped: does not work well with valgrind'
|
||||||
|
endif
|
||||||
|
endfunc
|
||||||
|
|
||||||
|
" Command to check for X11 based GUI
|
||||||
|
command CheckX11BasedGui call CheckX11BasedGui()
|
||||||
|
func CheckX11BasedGui()
|
||||||
|
if !g:x11_based_gui
|
||||||
|
throw 'Skipped: requires X11 based GUI'
|
||||||
|
endif
|
||||||
|
endfunc
|
||||||
|
|
||||||
" Command to check for satisfying any of the conditions.
|
" Command to check for satisfying any of the conditions.
|
||||||
" e.g. CheckAnyOf Feature:bsd Feature:sun Linux
|
" e.g. CheckAnyOf Feature:bsd Feature:sun Linux
|
||||||
command -nargs=+ CheckAnyOf call CheckAnyOf(<f-args>)
|
command -nargs=+ CheckAnyOf call CheckAnyOf(<f-args>)
|
||||||
|
@@ -285,6 +285,12 @@ func GetVimCommand(...)
|
|||||||
return cmd
|
return cmd
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
|
" Return one when it looks like the tests are run with valgrind, which means
|
||||||
|
" that everything is much slower.
|
||||||
|
func RunningWithValgrind()
|
||||||
|
return GetVimCommand() =~ '\<valgrind\>'
|
||||||
|
endfunc
|
||||||
|
|
||||||
" Get the command to run Vim, with --clean instead of "-u NONE".
|
" Get the command to run Vim, with --clean instead of "-u NONE".
|
||||||
func GetVimCommandClean()
|
func GetVimCommandClean()
|
||||||
let cmd = GetVimCommand()
|
let cmd = GetVimCommand()
|
||||||
|
@@ -13,9 +13,7 @@ source shared.vim
|
|||||||
|
|
||||||
func Check_X11_Connection()
|
func Check_X11_Connection()
|
||||||
if has('x11')
|
if has('x11')
|
||||||
if empty($DISPLAY)
|
CheckEnv DISPLAY
|
||||||
throw 'Skipped: $DISPLAY is not set'
|
|
||||||
endif
|
|
||||||
try
|
try
|
||||||
call remote_send('xxx', '')
|
call remote_send('xxx', '')
|
||||||
catch
|
catch
|
||||||
@@ -142,19 +140,19 @@ func Test_client_server()
|
|||||||
|
|
||||||
" Edit multiple files using --remote
|
" Edit multiple files using --remote
|
||||||
call system(cmd .. ' --remote Xfile1 Xfile2 Xfile3')
|
call system(cmd .. ' --remote Xfile1 Xfile2 Xfile3')
|
||||||
call assert_equal("Xfile1\nXfile2\nXfile3\n", remote_expr(name, 'argv()'))
|
call assert_match(".*Xfile1\n.*Xfile2\n.*Xfile3\n", remote_expr(name, 'argv()'))
|
||||||
eval name->remote_send(":%bw!\<CR>")
|
eval name->remote_send(":%bw!\<CR>")
|
||||||
|
|
||||||
" Edit files in separate tab pages
|
" Edit files in separate tab pages
|
||||||
call system(cmd .. ' --remote-tab Xfile1 Xfile2 Xfile3')
|
call system(cmd .. ' --remote-tab Xfile1 Xfile2 Xfile3')
|
||||||
call WaitForAssert({-> assert_equal('3', remote_expr(name, 'tabpagenr("$")'))})
|
call WaitForAssert({-> assert_equal('3', remote_expr(name, 'tabpagenr("$")'))})
|
||||||
call assert_equal('Xfile2', remote_expr(name, 'bufname(tabpagebuflist(2)[0])'))
|
call assert_match('.*\<Xfile2', remote_expr(name, 'bufname(tabpagebuflist(2)[0])'))
|
||||||
eval name->remote_send(":%bw!\<CR>")
|
eval name->remote_send(":%bw!\<CR>")
|
||||||
|
|
||||||
" Edit a file using --remote-wait
|
" Edit a file using --remote-wait
|
||||||
eval name->remote_send(":source $VIMRUNTIME/plugin/rrhelper.vim\<CR>")
|
eval name->remote_send(":source $VIMRUNTIME/plugin/rrhelper.vim\<CR>")
|
||||||
call system(cmd .. ' --remote-wait +enew Xfile1')
|
call system(cmd .. ' --remote-wait +enew Xfile1')
|
||||||
call assert_equal("Xfile1", remote_expr(name, 'bufname("#")'))
|
call assert_match('.*\<Xfile1', remote_expr(name, 'bufname("#")'))
|
||||||
eval name->remote_send(":%bw!\<CR>")
|
eval name->remote_send(":%bw!\<CR>")
|
||||||
|
|
||||||
" Edit files using --remote-tab-wait
|
" Edit files using --remote-tab-wait
|
||||||
@@ -184,8 +182,10 @@ func Test_client_server()
|
|||||||
|
|
||||||
call assert_fails('call remote_startserver([])', 'E730:')
|
call assert_fails('call remote_startserver([])', 'E730:')
|
||||||
call assert_fails("let x = remote_peek([])", 'E730:')
|
call assert_fails("let x = remote_peek([])", 'E730:')
|
||||||
call assert_fails("let x = remote_read('vim10')", ['E573:.*vim10'])
|
call assert_fails("let x = remote_read('vim10')",
|
||||||
call assert_fails("call server2client('abc', 'xyz')", ['E573:.*abc'])
|
\ has('unix') ? ['E573:.*vim10'] : 'E277:')
|
||||||
|
call assert_fails("call server2client('abc', 'xyz')",
|
||||||
|
\ has('unix') ? ['E573:.*abc'] : 'E258:')
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
" Uncomment this line to get a debugging log
|
" Uncomment this line to get a debugging log
|
||||||
|
@@ -117,6 +117,7 @@ func Test_exit_error_reading_input()
|
|||||||
CheckNotMSWindows
|
CheckNotMSWindows
|
||||||
" The early exit causes memory not to be freed somehow
|
" The early exit causes memory not to be freed somehow
|
||||||
CheckNotAsan
|
CheckNotAsan
|
||||||
|
CheckNotValgrind
|
||||||
|
|
||||||
call writefile([":au VimLeave * call writefile(['l = ' .. v:exiting], 'Xtestout')", ":tabnew", "q:"], 'Xscript', 'b')
|
call writefile([":au VimLeave * call writefile(['l = ' .. v:exiting], 'Xtestout')", ":tabnew", "q:"], 'Xscript', 'b')
|
||||||
|
|
||||||
|
@@ -522,7 +522,14 @@ func Test_geometry()
|
|||||||
[CODE]
|
[CODE]
|
||||||
if RunVim([], after, '-f -g -geometry 31x13+41+43')
|
if RunVim([], after, '-f -g -geometry 31x13+41+43')
|
||||||
let lines = readfile('Xtest_geometry')
|
let lines = readfile('Xtest_geometry')
|
||||||
call assert_equal(['31', '13', '41', '43', '[41, 43]'], lines)
|
" Depending on the GUI library and the windowing system the final size
|
||||||
|
" might be a bit different, allow for some tolerance. Tuned based on
|
||||||
|
" actual failures.
|
||||||
|
call assert_inrange(31, 35, str2nr(lines[0]))
|
||||||
|
call assert_equal('13', lines[1])
|
||||||
|
call assert_equal('41', lines[2])
|
||||||
|
call assert_equal('43', lines[3])
|
||||||
|
call assert_equal('[41, 43]', lines[4])
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user