diff src/testdir/test_vim9_expr.vim @ 20189:63cc54100ae4 v8.2.0650

patch 8.2.0650: Vim9: script function can be deleted Commit: https://github.com/vim/vim/commit/4c17ad94ecb0a0fb26d6fface2614bc5172dea18 Author: Bram Moolenaar <Bram@vim.org> Date: Mon Apr 27 22:47:51 2020 +0200 patch 8.2.0650: Vim9: script function can be deleted Problem: Vim9: script function can be deleted. Solution: Disallow deleting script function. Delete functions when sourcing a script again.
author Bram Moolenaar <Bram@vim.org>
date Mon, 27 Apr 2020 23:00:03 +0200
parents 0612c64a2b87
children 5a397db2c1ed
line wrap: on
line diff
--- a/src/testdir/test_vim9_expr.vim
+++ b/src/testdir/test_vim9_expr.vim
@@ -207,12 +207,12 @@ def Test_expr4_equal()
   assert_equal(true, g:adict == #{bbb: 8, aaa: 2})
   assert_equal(false, #{ccc: 9, aaa: 2} == g:adict)
 
-  assert_equal(true, function('Test_expr4_equal') == function('Test_expr4_equal'))
-  assert_equal(false, function('Test_expr4_equal') == function('Test_expr4_is'))
+  assert_equal(true, function('g:Test_expr4_equal') == function('g:Test_expr4_equal'))
+  assert_equal(false, function('g:Test_expr4_equal') == function('g:Test_expr4_is'))
 
-  assert_equal(true, function('Test_expr4_equal', [123]) == function('Test_expr4_equal', [123]))
-  assert_equal(false, function('Test_expr4_equal', [123]) == function('Test_expr4_is', [123]))
-  assert_equal(false, function('Test_expr4_equal', [123]) == function('Test_expr4_equal', [999]))
+  assert_equal(true, function('g:Test_expr4_equal', [123]) == function('g:Test_expr4_equal', [123]))
+  assert_equal(false, function('g:Test_expr4_equal', [123]) == function('g:Test_expr4_is', [123]))
+  assert_equal(false, function('g:Test_expr4_equal', [123]) == function('g:Test_expr4_equal', [999]))
 enddef
 
 " test != comperator
@@ -274,12 +274,12 @@ def Test_expr4_notequal()
   assert_equal(false, g:adict != #{bbb: 8, aaa: 2})
   assert_equal(true, #{ccc: 9, aaa: 2} != g:adict)
 
-  assert_equal(false, function('Test_expr4_equal') != function('Test_expr4_equal'))
-  assert_equal(true, function('Test_expr4_equal') != function('Test_expr4_is'))
+  assert_equal(false, function('g:Test_expr4_equal') != function('g:Test_expr4_equal'))
+  assert_equal(true, function('g:Test_expr4_equal') != function('g:Test_expr4_is'))
 
-  assert_equal(false, function('Test_expr4_equal', [123]) != function('Test_expr4_equal', [123]))
-  assert_equal(true, function('Test_expr4_equal', [123]) != function('Test_expr4_is', [123]))
-  assert_equal(true, function('Test_expr4_equal', [123]) != function('Test_expr4_equal', [999]))
+  assert_equal(false, function('g:Test_expr4_equal', [123]) != function('g:Test_expr4_equal', [123]))
+  assert_equal(true, function('g:Test_expr4_equal', [123]) != function('g:Test_expr4_is', [123]))
+  assert_equal(true, function('g:Test_expr4_equal', [123]) != function('g:Test_expr4_equal', [999]))
 enddef
 
 " test > comperator
@@ -929,15 +929,15 @@ endfunc
 
 def Test_expr7_trailing()
   " user function call
-  assert_equal(123, CallMe(123))
-  assert_equal(123, CallMe(  123))
-  assert_equal(123, CallMe(123  ))
-  assert_equal('yesno', CallMe2('yes', 'no'))
-  assert_equal('yesno', CallMe2( 'yes', 'no' ))
-  assert_equal('nothing', CallMe('nothing'))
+  assert_equal(123, g:CallMe(123))
+  assert_equal(123, g:CallMe(  123))
+  assert_equal(123, g:CallMe(123  ))
+  assert_equal('yesno', g:CallMe2('yes', 'no'))
+  assert_equal('yesno', g:CallMe2( 'yes', 'no' ))
+  assert_equal('nothing', g:CallMe('nothing'))
 
   " partial call
-  let Part = function('CallMe')
+  let Part = function('g:CallMe')
   assert_equal('yes', Part('yes'))
 
   " funcref call, using list index