Problem: Vim9: some tests fail.
Solution: Fix the tests, mostly by removing "s:".
call assert_equal(4, Ref('text'))
END
call v9.CheckTransLegacySuccess(lines)
- " cannot create s: variable in :def function
+ " skip CheckTransDefSuccess(), cannot assign to script variable
+ call map(lines, {k, v -> v =~ 'legacy' ? v : substitute(v, 's:', '', 'g')})
call v9.CheckTransVim9Success(lines)
endfunc
call assert_fails('let l:.trim = {x -> " " .. x}', 'E704:')
let lines =<< trim END
vim9script
- var s:trim = (x) => " " .. x
+ var trim = (x) => " " .. x
END
call v9.CheckScriptFailure(lines, 'E704:')
bw!
# Test for using a script-local function name
- def s:LocalCompleteFunc(findstart: number, base: string): any
+ def LocalCompleteFunc(findstart: number, base: string): any
add(g:LocalCompleteFuncArgs, [findstart, base])
return findstart ? 0 : []
enddef
- &completefunc = s:LocalCompleteFunc
+ &completefunc = LocalCompleteFunc
new | only
setline(1, 'three')
g:LocalCompleteFuncArgs = []
bw!
# Test for using a script-local function name
- def s:LocalOmniFunc(findstart: number, base: string): any
+ def LocalOmniFunc(findstart: number, base: string): any
add(g:LocalOmniFuncArgs, [findstart, base])
return findstart ? 0 : []
enddef
- &omnifunc = s:LocalOmniFunc
+ &omnifunc = LocalOmniFunc
new | only
setline(1, 'three')
g:LocalOmniFuncArgs = []
bw!
# Test for using a script-local function name
- def s:LocalTsrFunc(findstart: number, base: string): any
+ def LocalTsrFunc(findstart: number, base: string): any
add(g:LocalTsrFuncArgs, [findstart, base])
return findstart ? 0 : []
enddef
- &thesaurusfunc = s:LocalTsrFunc
+ &thesaurusfunc = LocalTsrFunc
new | only
setline(1, 'three')
g:LocalTsrFuncArgs = []
bw!
# Test for using a script-local function name
- def s:LocalOpFunc(type: string): void
+ def LocalOpFunc(type: string): void
g:LocalOpFuncArgs = [type]
enddef
- &opfunc = s:LocalOpFunc
+ &opfunc = LocalOpFunc
g:LocalOpFuncArgs = []
normal! g@l
assert_equal(['char'], g:LocalOpFuncArgs)
bw!
# Test for using a script-local function name
- def s:LocalTagFunc(pat: string, flags: string, info: dict<any> ): any
+ def LocalTagFunc(pat: string, flags: string, info: dict<any> ): any
g:LocalTagFuncArgs = [pat, flags, info]
return null
enddef
- &tagfunc = s:LocalTagFunc
+ &tagfunc = LocalTagFunc
new
g:LocalTagFuncArgs = []
assert_fails('tag a12', 'E433:')
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 4361,
/**/
4360,
/**/