test(old): skip Vim9 script with less divergence

This commit is contained in:
zeertzjq
2022-12-03 20:27:09 +08:00
parent 742d95a629
commit 3838ee63d0
5 changed files with 15 additions and 6 deletions

View File

@@ -2,6 +2,9 @@
source shared.vim source shared.vim
source check.vim source check.vim
source term_util.vim
source screendump.vim
source vim9.vim
" Must be done first, since the alternate buffer must be unset. " Must be done first, since the alternate buffer must be unset.
func Test_00_bufexists() func Test_00_bufexists()
@@ -2518,7 +2521,7 @@ func Test_builtin_check()
vim9script vim9script
var s:trim = (x) => " " .. x var s:trim = (x) => " " .. x
END END
" call CheckScriptFailure(lines, 'E704:') call CheckScriptFailure(lines, 'E704:')
call assert_fails('call extend(g:, #{foo: { -> "foo" }})', 'E704:') call assert_fails('call extend(g:, #{foo: { -> "foo" }})', 'E704:')
let g:bar = 123 let g:bar = 123

View File

@@ -1535,7 +1535,7 @@ func Test_completefunc_callback()
assert_equal([[1, ''], [0, 'three']], g:LocalCompleteFuncArgs) assert_equal([[1, ''], [0, 'three']], g:LocalCompleteFuncArgs)
bw! bw!
END END
" call CheckScriptSuccess(lines) call CheckScriptSuccess(lines)
" cleanup " cleanup
set completefunc& set completefunc&
@@ -1792,7 +1792,7 @@ func Test_omnifunc_callback()
assert_equal([[1, ''], [0, 'three']], g:LocalOmniFuncArgs) assert_equal([[1, ''], [0, 'three']], g:LocalOmniFuncArgs)
bw! bw!
END END
" call CheckScriptSuccess(lines) call CheckScriptSuccess(lines)
" cleanup " cleanup
set omnifunc& set omnifunc&
@@ -2085,7 +2085,7 @@ func Test_thesaurusfunc_callback()
assert_equal([[1, ''], [0, 'three']], g:LocalTsrFuncArgs) assert_equal([[1, ''], [0, 'three']], g:LocalTsrFuncArgs)
bw! bw!
END END
" call CheckScriptSuccess(lines) call CheckScriptSuccess(lines)
" cleanup " cleanup
set thesaurusfunc& set thesaurusfunc&

View File

@@ -695,7 +695,7 @@ func Test_opfunc_callback()
assert_equal(['char'], g:LocalOpFuncArgs) assert_equal(['char'], g:LocalOpFuncArgs)
bw! bw!
END END
" call CheckScriptSuccess(lines) call CheckScriptSuccess(lines)
" setting 'opfunc' to a script local function outside of a script context " setting 'opfunc' to a script local function outside of a script context
" should fail " should fail

View File

@@ -380,7 +380,7 @@ func Test_tagfunc_callback()
assert_equal(['a12', '', {}], g:LocalTagFuncArgs) assert_equal(['a12', '', {}], g:LocalTagFuncArgs)
bw! bw!
END END
" call CheckScriptSuccess(lines) call CheckScriptSuccess(lines)
" cleanup " cleanup
delfunc TagFunc1 delfunc TagFunc1

View File

@@ -3,6 +3,9 @@
let s:sequence = 1 let s:sequence = 1
func CheckScriptFailure(lines, error, lnum = -3) func CheckScriptFailure(lines, error, lnum = -3)
if get(a:lines, 0, '') ==# 'vim9script'
return
endif
let cwd = getcwd() let cwd = getcwd()
let fname = 'XScriptFailure' .. s:sequence let fname = 'XScriptFailure' .. s:sequence
let s:sequence += 1 let s:sequence += 1
@@ -16,6 +19,9 @@ func CheckScriptFailure(lines, error, lnum = -3)
endfunc endfunc
func CheckScriptSuccess(lines) func CheckScriptSuccess(lines)
if get(a:lines, 0, '') ==# 'vim9script'
return
endif
let cwd = getcwd() let cwd = getcwd()
let fname = 'XScriptSuccess' .. s:sequence let fname = 'XScriptSuccess' .. s:sequence
let s:sequence += 1 let s:sequence += 1