mirror of
https://github.com/vim/vim.git
synced 2025-09-23 03:43:49 -04:00
CI(screendump): Move an early-return test out of the loop
And express the established indentation style of the file in its modeline. related: #17704 Signed-off-by: Aliaksei Budavei <0x000c70@gmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
committed by
Christian Brabandt
parent
25ea22439e
commit
64329714c7
@@ -66,34 +66,30 @@ func VerifyScreenDump(buf, filename, options, ...)
|
|||||||
" text and attributes only from the internal buffer.
|
" text and attributes only from the internal buffer.
|
||||||
redraw
|
redraw
|
||||||
|
|
||||||
if filereadable(reference)
|
|
||||||
let refdump = ReadAndFilter(reference, filter)
|
|
||||||
else
|
|
||||||
" Must be a new screendump, always fail
|
|
||||||
let refdump = []
|
|
||||||
endif
|
|
||||||
|
|
||||||
let did_mkdir = 0
|
let did_mkdir = 0
|
||||||
if !isdirectory('failed')
|
if !isdirectory('failed')
|
||||||
let did_mkdir = 1
|
let did_mkdir = 1
|
||||||
call mkdir('failed')
|
call mkdir('failed')
|
||||||
endif
|
endif
|
||||||
|
|
||||||
let i = 0
|
if !filereadable(reference)
|
||||||
while 1
|
" Leave a bit of time for updating the original window while we spin wait.
|
||||||
" leave a bit of time for updating the original window while we spin wait.
|
sleep 10m
|
||||||
sleep 1m
|
|
||||||
call delete(testfile)
|
call delete(testfile)
|
||||||
call term_dumpwrite(a:buf, testfile, a:options)
|
call term_dumpwrite(a:buf, testfile, a:options)
|
||||||
|
call assert_report('See new dump file: call term_dumpload("testdir/' .. testfile .. '")')
|
||||||
if refdump->empty()
|
" No point in retrying.
|
||||||
let msg = 'See new dump file: call term_dumpload("testdir/' .. testfile .. '")'
|
|
||||||
call assert_report(msg)
|
|
||||||
" no point in retrying
|
|
||||||
let g:run_nr = 10
|
let g:run_nr = 10
|
||||||
return 1
|
return 1
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
let refdump = ReadAndFilter(reference, filter)
|
||||||
|
let i = 0
|
||||||
|
while 1
|
||||||
|
" Leave a bit of time for updating the original window while we spin wait.
|
||||||
|
sleep 1m
|
||||||
|
call delete(testfile)
|
||||||
|
call term_dumpwrite(a:buf, testfile, a:options)
|
||||||
let testdump = ReadAndFilter(testfile, filter)
|
let testdump = ReadAndFilter(testfile, filter)
|
||||||
if refdump == testdump
|
if refdump == testdump
|
||||||
call delete(testfile)
|
call delete(testfile)
|
||||||
@@ -137,3 +133,5 @@ func VerifyScreenDump(buf, filename, options, ...)
|
|||||||
endwhile
|
endwhile
|
||||||
return 0
|
return 0
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
|
" vim:sw=2:ts=8:noet:
|
||||||
|
Reference in New Issue
Block a user