mirror of
https://github.com/Raimondi/delimitMate.git
synced 2025-12-06 04:34:29 +08:00
Fix tests.
This commit is contained in:
@@ -7,6 +7,8 @@ call vimtap#Plan(testsnumber)
|
||||
let tcount = 1
|
||||
let expect = 0
|
||||
let evaluate = 0
|
||||
let commands = []
|
||||
let header = ''
|
||||
for item in lines
|
||||
if item =~ '^=\{80}$'
|
||||
let expect = 1
|
||||
@@ -14,14 +16,20 @@ for item in lines
|
||||
continue
|
||||
endif
|
||||
|
||||
if item =~ '^#\|^\s*$' && expect == 0
|
||||
" A comment or empty line.
|
||||
if item =~ '^#' && expect == 0
|
||||
" A comment.
|
||||
let header = empty(header) ? item[1:] : 'Lines should match.'
|
||||
continue
|
||||
endif
|
||||
if item =~ '^\s*$' && expect == 0
|
||||
" An empty line.
|
||||
continue
|
||||
endif
|
||||
if ! expect
|
||||
" A command.
|
||||
call add(commands, item)
|
||||
exec item
|
||||
call vimtap#Diag(item)
|
||||
"call vimtap#Diag(item)
|
||||
continue
|
||||
endif
|
||||
if item =~ '^-\{80}$'
|
||||
@@ -35,8 +43,13 @@ for item in lines
|
||||
let passed = lines == expected
|
||||
echom string(lines)
|
||||
echom string(expected)
|
||||
call vimtap#Ok(passed, string(expected) .
|
||||
\ (passed ? ' =' : ' !') . '= ' . string(lines))
|
||||
call vimtap#Is(lines, expected, header)
|
||||
echom string(commands)
|
||||
for cmd in commands
|
||||
call vimtap#Diag(cmd)
|
||||
endfor
|
||||
let commands = []
|
||||
let header = ''
|
||||
let tcount += 1
|
||||
endfor
|
||||
call vimtest#Quit()
|
||||
|
||||
Reference in New Issue
Block a user