0
0
mirror of https://github.com/vim/vim.git synced 2025-09-26 04:04:07 -04:00

patch 8.2.0336: Vim9: insufficient test coverage for compiling

Problem:    Vim9: insufficient test coverage for compiling.
Solution:   Add more tests.
This commit is contained in:
Bram Moolenaar
2020-02-29 23:23:47 +01:00
parent cc390ff5b2
commit 42a480bf72
6 changed files with 176 additions and 13 deletions

View File

@@ -9,6 +9,12 @@ func CheckDefFailure(line, error)
call delete('Xdef')
endfunc
func CheckDefFailureMult(lines, error)
call writefile(['def! Func()'] + a:lines + ['enddef'], 'Xdef')
call assert_fails('so Xdef', a:error, join(a:lines, ' | '))
call delete('Xdef')
endfunc
" Check that "line" inside ":def" results in an "error" message when executed.
func CheckDefExecFailure(line, error)
call writefile(['def! Func()', a:line, 'enddef'], 'Xdef')
@@ -805,6 +811,8 @@ func Test_expr7_fails()
call CheckDefExecFailure("let x = +g:ablob", 'E974:')
call CheckDefExecFailure("let x = +g:alist", 'E745:')
call CheckDefExecFailure("let x = +g:adict", 'E728:')
call CheckDefFailureMult(["let x = ''", "let y = x.memb"], 'E715:')
endfunc
let g:Funcrefs = [function('add')]