diff src/testdir/test_highlight.vim @ 27457:4c16acb2525f v8.2.4257

patch 8.2.4257: Vim9: finding global function without g: prefix inconsistent Commit: https://github.com/vim/vim/commit/62aec93bfdb9e1b40d03a6d2e8e9511f8b1bdb2d Author: Bram Moolenaar <Bram@vim.org> Date: Sat Jan 29 21:45:34 2022 +0000 patch 8.2.4257: Vim9: finding global function without g: prefix inconsistent Problem: Vim9: finding global function without g: prefix but not finding global variable is inconsistent. Solution: Require using g: for a global function. Change the vim9.vim script into a Vim9 script with exports. Fix that import in legacy script does not work.
author Bram Moolenaar <Bram@vim.org>
date Sat, 29 Jan 2022 23:00:05 +0100
parents 6f43253463cc
children 95d6e3c9aa1e
line wrap: on
line diff
--- a/src/testdir/test_highlight.vim
+++ b/src/testdir/test_highlight.vim
@@ -4,7 +4,7 @@ source view_util.vim
 source screendump.vim
 source check.vim
 source script_util.vim
-source vim9.vim
+import './vim9.vim' as v9
 
 func ClearDict(d)
   for k in keys(a:d)
@@ -1011,7 +1011,7 @@ func Test_hlget()
     call assert_equal([], hlget(test_null_string()))
     call assert_equal([], hlget(""))
   END
-  call CheckLegacyAndVim9Success(lines)
+  call v9.CheckLegacyAndVim9Success(lines)
 
   " Test for resolving highlight group links
   let lines =<< trim END
@@ -1042,7 +1042,7 @@ func Test_hlget()
     call assert_equal([{'id': hlgCid, 'name': 'hlgC',
                       \ 'term': {'bold': v:true}}], hlget('hlgC', v:true))
   END
-  call CheckLegacyAndVim9Success(lines)
+  call v9.CheckLegacyAndVim9Success(lines)
 
   call assert_fails('call hlget([])', 'E1174:')
   call assert_fails('call hlget("abc", "xyz")', 'E1212:')
@@ -1098,7 +1098,7 @@ func Test_hlset()
     call assert_equal('Search', hlget('NewHLGroup')[0].linksto)
     highlight clear NewHLGroup
   END
-  call CheckLegacyAndVim9Success(lines)
+  call v9.CheckLegacyAndVim9Success(lines)
 
   " Test for clearing the 'term', 'cterm' and 'gui' attributes of a highlight
   " group.
@@ -1117,7 +1117,7 @@ func Test_hlset()
                 \ hlget('myhlg1'))
     highlight clear myhlg1
   END
-  call CheckLegacyAndVim9Success(lines)
+  call v9.CheckLegacyAndVim9Success(lines)
 
   " Test for setting all the 'term', 'cterm' and 'gui' attributes of a
   " highlight group
@@ -1134,7 +1134,7 @@ func Test_hlset()
     call assert_equal([{'id': id2, 'name': 'myhlg2', 'gui': attr,
                       \ 'term': attr, 'cterm': attr}], hlget('myhlg2'))
   END
-  call CheckLegacyAndVim9Success(lines)
+  call v9.CheckLegacyAndVim9Success(lines)
 
   " Test for clearing some of the 'term', 'cterm' and 'gui' attributes of a
   " highlight group
@@ -1150,7 +1150,7 @@ func Test_hlset()
     call assert_equal([{'id': id2, 'name': 'myhlg2', 'gui': attr,
                       \ 'term': attr, 'cterm': attr}], hlget('myhlg2'))
   END
-  call CheckLegacyAndVim9Success(lines)
+  call v9.CheckLegacyAndVim9Success(lines)
 
   " Test for clearing the attributes and link of a highlight group
   let lines =<< trim END
@@ -1162,7 +1162,7 @@ func Test_hlset()
                       \ hlget('myhlg3'))
     highlight clear hlg3
   END
-  call CheckLegacyAndVim9Success(lines)
+  call v9.CheckLegacyAndVim9Success(lines)
 
   " Test for setting default attributes for a highlight group
   let lines =<< trim END
@@ -1187,7 +1187,7 @@ func Test_hlset()
                     \ hlget('hlg6'))
     highlight clear hlg6
   END
-  call CheckLegacyAndVim9Success(lines)
+  call v9.CheckLegacyAndVim9Success(lines)
 
   " Test for setting default links for a highlight group
   let lines =<< trim END
@@ -1217,7 +1217,7 @@ func Test_hlset()
                     \ 'linksto': 'ErrorMsg'}], hlget('hlg9dup'))
     highlight clear hlg9
   END
-  call CheckLegacyAndVim9Success(lines)
+  call v9.CheckLegacyAndVim9Success(lines)
 
   " Test for force creating a link to a highlight group
   let lines =<< trim END
@@ -1231,7 +1231,7 @@ func Test_hlset()
                     \ 'linksto': 'Search'}], hlget('hlg10'))
     highlight clear hlg10
   END
-  call CheckLegacyAndVim9Success(lines)
+  call v9.CheckLegacyAndVim9Success(lines)
 
   " Test for empty values of attributes
   call hlset([{'name': 'hlg11', 'cterm': {}}])