" Tests for the Vim script debug commands
source shared.vim
source screendump.vim
source check.vim
CheckRunVimInTerminal
func CheckCWD()
" Check that the longer lines don't wrap due to the length of the script name
" in cwd
let script_len = len( getcwd() .. '/Xtest1.vim' )
let longest_line = len( 'Breakpoint in "" line 1' )
if script_len > ( 75 - longest_line )
throw 'Skipped: Your CWD has too many characters'
endif
endfunc
command! -nargs=0 -bar CheckCWD call CheckCWD()
" "options" argument can contain:
" 'msec' - time to wait for a match
" 'match' - "pattern" to use "lines" as pattern instead of text
def s:CheckDbgOutput(buf: number, lines: list<string>, options = {})
# Verify the expected output
var lnum = 20 - len(lines)
var msec = get(options, 'msec', 1000)
for l in lines
if get(options, 'match', 'equal') ==# 'pattern'
g:WaitForAssert(() => assert_match(l, term_getline(buf, lnum)), msec)
else
g:WaitForAssert(() => assert_equal(l, term_getline(buf, lnum)), msec)
endif
lnum += 1
endfor
enddef
" Run a Vim debugger command
" If the expected output argument is supplied, then check for it.
def s:RunDbgCmd