aboutsummaryrefslogtreecommitdiff
path: root/test/old/testdir/vim9.vim
diff options
context:
space:
mode:
Diffstat (limited to 'test/old/testdir/vim9.vim')
-rw-r--r--test/old/testdir/vim9.vim47
1 files changed, 47 insertions, 0 deletions
diff --git a/test/old/testdir/vim9.vim b/test/old/testdir/vim9.vim
index 825f01c9d6..218fab6c5e 100644
--- a/test/old/testdir/vim9.vim
+++ b/test/old/testdir/vim9.vim
@@ -2,6 +2,10 @@
" Use a different file name for each run.
let s:sequence = 1
+func CheckDefSuccess(lines)
+ return
+endfunc
+
func CheckDefFailure(lines, error, lnum = -3)
return
endfunc
@@ -42,6 +46,49 @@ func CheckScriptSuccess(lines)
endtry
endfunc
+" :source a list of "lines" and check whether it fails with "error"
+func CheckSourceFailure(lines, error, lnum = -3)
+ if get(a:lines, 0, '') ==# 'vim9script'
+ return
+ endif
+ new
+ call setline(1, a:lines)
+ try
+ call assert_fails('source', a:error, a:lines, a:lnum)
+ finally
+ bw!
+ endtry
+endfunc
+
+" :source a list of "lines" and check whether it fails with the list of
+" "errors"
+func CheckSourceFailureList(lines, errors, lnum = -3)
+ if get(a:lines, 0, '') ==# 'vim9script'
+ return
+ endif
+ new
+ call setline(1, a:lines)
+ try
+ call assert_fails('source', a:errors, a:lines, a:lnum)
+ finally
+ bw!
+ endtry
+endfunc
+
+" :source a list of "lines" and check whether it succeeds
+func CheckSourceSuccess(lines)
+ if get(a:lines, 0, '') ==# 'vim9script'
+ return
+ endif
+ new
+ call setline(1, a:lines)
+ try
+ :source
+ finally
+ bw!
+ endtry
+endfunc
+
func CheckDefAndScriptSuccess(lines)
return
endfunc