diff src/testdir/test_textprop.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 e624b4ddbdf0
children 95d6e3c9aa1e
line wrap: on
line diff
--- a/src/testdir/test_textprop.vim
+++ b/src/testdir/test_textprop.vim
@@ -5,7 +5,7 @@ source check.vim
 CheckFeature textprop
 
 source screendump.vim
-source vim9.vim
+import './vim9.vim' as v9
 
 func Test_proptype_global()
   call prop_type_add('comment', {'highlight': 'Directory', 'priority': 123, 'start_incl': 1, 'end_incl': 1})
@@ -429,10 +429,10 @@ enddef
 
 def Test_prop_remove_vim9()
   new
-  AddPropTypes()
-  SetupPropsInFirstLine()
+  g:AddPropTypes()
+  g:SetupPropsInFirstLine()
   assert_equal(1, prop_remove({type: 'three', id: 13, both: true, all: true}))
-  DeletePropTypes()
+  g:DeletePropTypes()
   bwipe!
 enddef
 
@@ -1704,7 +1704,7 @@ enddef
 func Test_prop_list()
   let lines =<< trim END
     new
-    call AddPropTypes()
+    call g:AddPropTypes()
     call setline(1, repeat([repeat('a', 60)], 10))
     call prop_add(1, 4, {'type': 'one', 'id': 5, 'end_col': 6})
     call prop_add(1, 5, {'type': 'two', 'id': 10, 'end_col': 7})
@@ -1844,10 +1844,10 @@ func Test_prop_list()
     bunload! Xaaa
     call assert_equal([], prop_list(1, {'bufnr': bnr, 'end_lnum': -1}))
 
-    call DeletePropTypes()
+    call g:DeletePropTypes()
     :%bw!
   END
-  call CheckLegacyAndVim9Success(lines)
+  call v9.CheckLegacyAndVim9Success(lines)
 endfunc
 
 " vim: shiftwidth=2 sts=2 expandtab