vim-patch:8.0.0498 (#7103)

Problem:    Two autocmd tests are skipped on MS-Windows.
Solution:   Make the test pass on MS-Windows. Write the messages in a file
            instead of getting the output of system().
e94260f358
This commit is contained in:
Justin M. Keyes 2017-07-31 03:54:18 +02:00 committed by GitHub
parent b5e713e70d
commit 10399165e5
2 changed files with 30 additions and 28 deletions

View File

@ -342,7 +342,10 @@ func Test_BufEnter()
call mkdir('Xdir') call mkdir('Xdir')
split Xdir split Xdir
call assert_equal('+++', g:val) call assert_equal('+++', g:val)
bwipe!
" On MS-Windows we can't edit the directory, make sure we wipe the right
" buffer.
bwipe! Xdir
call delete('Xdir', 'd') call delete('Xdir', 'd')
au! BufEnter au! BufEnter
@ -351,40 +354,37 @@ endfunc
" Closing a window might cause an endless loop " Closing a window might cause an endless loop
" E814 for older Vims " E814 for older Vims
function Test_autocmd_bufwipe_in_SessLoadPost() function Test_autocmd_bufwipe_in_SessLoadPost()
if has('win32')
throw 'Skipped: test hangs on MS-Windows'
endif
tabnew tabnew
set noswapfile set noswapfile
let g:bufnr=bufnr('%')
mksession! mksession!
let content=['set nocp noswapfile', let content = ['set nocp noswapfile',
\ 'let v:swapchoice="e"', \ 'let v:swapchoice="e"',
\ 'augroup test_autocmd_sessionload', \ 'augroup test_autocmd_sessionload',
\ 'autocmd!', \ 'autocmd!',
\ 'autocmd SessionLoadPost * 4bw!|qall!', \ 'autocmd SessionLoadPost * 4bw!',
\ 'augroup END', \ 'augroup END',
\ '',
\ 'func WriteErrors()',
\ ' call writefile([execute("messages")], "Xerrors")',
\ 'endfunc',
\ 'au VimLeave * call WriteErrors()',
\ ] \ ]
call writefile(content, 'Xvimrc') call writefile(content, 'Xvimrc')
let a=system(v:progpath. ' --headless -i NONE -u Xvimrc --noplugins -S Session.vim') call system(v:progpath. ' --headless -i NONE -u Xvimrc --noplugins -S Session.vim -c cq')
call assert_match('E814', a) let errors = join(readfile('Xerrors'))
call assert_match('E814', errors)
unlet! g:bufnr
set swapfile set swapfile
for file in ['Session.vim', 'Xvimrc'] for file in ['Session.vim', 'Xvimrc', 'Xerrors']
call delete(file) call delete(file)
endfor endfor
endfunc endfunc
" SEGV occurs in older versions. " SEGV occurs in older versions.
function Test_autocmd_bufwipe_in_SessLoadPost2() function Test_autocmd_bufwipe_in_SessLoadPost2()
if has('win32')
throw 'Skipped: test hangs on MS-Windows'
endif
tabnew tabnew
set noswapfile set noswapfile
let g:bufnr=bufnr('%')
mksession! mksession!
let content = ['set nocp noswapfile', let content = ['set nocp noswapfile',
@ -399,22 +399,24 @@ function Test_autocmd_bufwipe_in_SessLoadPost2()
\ ' exec ''bwipeout '' . b', \ ' exec ''bwipeout '' . b',
\ ' endif', \ ' endif',
\ ' endfor', \ ' endfor',
\ 'redraw!', \ ' echomsg "SessionLoadPost DONE"',
\ 'echon "SessionLoadPost DONE"',
\ 'qall!',
\ 'endfunction', \ 'endfunction',
\ 'au SessionLoadPost * call DeleteInactiveBufs()'] \ 'au SessionLoadPost * call DeleteInactiveBufs()',
\ '',
\ 'func WriteErrors()',
\ ' call writefile([execute("messages")], "Xerrors")',
\ 'endfunc',
\ 'au VimLeave * call WriteErrors()',
\ ]
call writefile(content, 'Xvimrc') call writefile(content, 'Xvimrc')
let a=system(v:progpath. ' --headless -i NONE -u Xvimrc --noplugins -S Session.vim') call system(v:progpath. ' --headless -i NONE -u Xvimrc --noplugins -S Session.vim -c cq')
" this probably only matches on unix let errors = join(readfile('Xerrors'))
if has("unix") " This probably only ever matches on unix.
call assert_notmatch('Caught deadly signal SEGV', a) call assert_notmatch('Caught deadly signal SEGV', errors)
endif call assert_match('SessionLoadPost DONE', errors)
call assert_match('SessionLoadPost DONE', a)
unlet! g:bufnr
set swapfile set swapfile
for file in ['Session.vim', 'Xvimrc'] for file in ['Session.vim', 'Xvimrc', 'Xerrors']
call delete(file) call delete(file)
endfor endfor
endfunc endfunc

View File

@ -231,7 +231,7 @@ static const int included_patches[] = {
// 501, // 501,
// 500, // 500,
499, 499,
// 498, 498,
// 497, // 497,
// 496, // 496,
// 495, // 495,