]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 8.2.4361: Vim9: some tests fail v8.2.4361
authorBram Moolenaar <Bram@vim.org>
Sat, 12 Feb 2022 20:34:50 +0000 (20:34 +0000)
committerBram Moolenaar <Bram@vim.org>
Sat, 12 Feb 2022 20:34:50 +0000 (20:34 +0000)
Problem:    Vim9: some tests fail.
Solution:   Fix the tests, mostly by removing "s:".

src/testdir/test_expr.vim
src/testdir/test_functions.vim
src/testdir/test_ins_complete.vim
src/testdir/test_normal.vim
src/testdir/test_tagfunc.vim
src/version.c

index 2189a0e8c62d736df822b254a57a4632515f6bb0..d45b998c4053a5644c9a4131e512e32da796e0a1 100644 (file)
@@ -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
 
index 6baba9707bc92b5b9b63a86ef0ded2467533ef00..e2820db9c9e5deeb1f165300a6507eacde0402e7 100644 (file)
@@ -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:')
 
index 933f4434be816f9ac4c52d8428e481e51d0c92d7..7e3fd296e2f1ab8c8b994b397c0ac3a2cc8c2675 100644 (file)
@@ -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 = []
index 2ed6a80dfa36c29a3199f754a455e1388a220362..cd987ab3d0035ca127db33ff1db6ed1ac73c3ba0 100644 (file)
@@ -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)
index 66a58ec47b2960af94d20b809254a317c426c6d5..05d8473cfb798b5b863f5c7305408fc673c9603b 100644 (file)
@@ -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:')
index 1c59ff9cb5a0a86e642d750f2cc91763fce1a4e9..933fe3606201fd0cc6abe8fc8709b6e4bea4f99c 100644 (file)
@@ -750,6 +750,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    4361,
 /**/
     4360,
 /**/