diff options
author | Bram Moolenaar <Bram@vim.org> | 2022-02-12 20:34:50 +0000 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2022-02-12 20:34:50 +0000 |
commit | 62b191c38758c835a577ef091a803b6dd4cd4f49 (patch) | |
tree | 1d7fdccfcddfd140e70de5ff90e7f07451c77f3a /src/testdir | |
parent | a749a42ed25534c88c636e5ab6603f1f97b857a4 (diff) |
patch 8.2.4361: Vim9: some tests failv8.2.4361
Problem: Vim9: some tests fail.
Solution: Fix the tests, mostly by removing "s:".
Diffstat (limited to 'src/testdir')
-rw-r--r-- | src/testdir/test_expr.vim | 3 | ||||
-rw-r--r-- | src/testdir/test_functions.vim | 2 | ||||
-rw-r--r-- | src/testdir/test_ins_complete.vim | 12 | ||||
-rw-r--r-- | src/testdir/test_normal.vim | 4 | ||||
-rw-r--r-- | src/testdir/test_tagfunc.vim | 4 |
5 files changed, 13 insertions, 12 deletions
diff --git a/src/testdir/test_expr.vim b/src/testdir/test_expr.vim index 2189a0e8c6..d45b998c40 100644 --- a/src/testdir/test_expr.vim +++ b/src/testdir/test_expr.vim @@ -612,7 +612,8 @@ func Test_function_with_funcref() 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 diff --git a/src/testdir/test_functions.vim b/src/testdir/test_functions.vim index 6baba9707b..e2820db9c9 100644 --- a/src/testdir/test_functions.vim +++ b/src/testdir/test_functions.vim @@ -2798,7 +2798,7 @@ func Test_builtin_check() 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:') diff --git a/src/testdir/test_ins_complete.vim b/src/testdir/test_ins_complete.vim index 933f4434be..7e3fd296e2 100644 --- a/src/testdir/test_ins_complete.vim +++ b/src/testdir/test_ins_complete.vim @@ -1514,11 +1514,11 @@ func Test_completefunc_callback() 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 = [] @@ -1771,11 +1771,11 @@ func Test_omnifunc_callback() 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 = [] @@ -2064,11 +2064,11 @@ func Test_thesaurusfunc_callback() 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 = [] diff --git a/src/testdir/test_normal.vim b/src/testdir/test_normal.vim index 2ed6a80dfa..cd987ab3d0 100644 --- a/src/testdir/test_normal.vim +++ b/src/testdir/test_normal.vim @@ -684,10 +684,10 @@ func Test_opfunc_callback() 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) diff --git a/src/testdir/test_tagfunc.vim b/src/testdir/test_tagfunc.vim index 66a58ec47b..05d8473cfb 100644 --- a/src/testdir/test_tagfunc.vim +++ b/src/testdir/test_tagfunc.vim @@ -369,11 +369,11 @@ func Test_tagfunc_callback() 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:') |