comparison src/testdir/test_vim9_func.vim @ 22264:e0a4d029cb87 v8.2.1681

patch 8.2.1681: Vim9: unnessary :call commands in tests Commit: https://github.com/vim/vim/commit/08052228a72074cdb0165e65f01b2fa8fce867ea Author: Bram Moolenaar <Bram@vim.org> Date: Mon Sep 14 17:04:31 2020 +0200 patch 8.2.1681: Vim9: unnessary :call commands in tests Problem: Vim9: unnessary :call commands in tests. Solution: Remove the commands. (issue https://github.com/vim/vim/issues/6936)
author Bram Moolenaar <Bram@vim.org>
date Mon, 14 Sep 2020 17:15:04 +0200
parents 3d0632b260fd
children 6b385c2b9ff5
comparison
equal deleted inserted replaced
22263:8a31402b1f81 22264:e0a4d029cb87
277 def Func(s: string) 277 def Func(s: string)
278 echo s 278 echo s
279 enddef 279 enddef
280 Func([]) 280 Func([])
281 END 281 END
282 call CheckScriptFailure(lines, 'E1013: argument 1: type mismatch, expected string but got list<unknown>', 5) 282 CheckScriptFailure(lines, 'E1013: argument 1: type mismatch, expected string but got list<unknown>', 5)
283 enddef 283 enddef
284 284
285 " Default arg and varargs 285 " Default arg and varargs
286 def MyDefVarargs(one: string, two = 'foo', ...rest: list<string>): string 286 def MyDefVarargs(one: string, two = 'foo', ...rest: list<string>): string
287 let res = one .. ',' .. two 287 let res = one .. ',' .. two
1097 # comment 1097 # comment
1098 invalid 1098 invalid
1099 enddef 1099 enddef
1100 defcompile 1100 defcompile
1101 END 1101 END
1102 call writefile(lines, 'Xdef') 1102 writefile(lines, 'Xdef')
1103 try 1103 try
1104 source Xdef 1104 source Xdef
1105 assert_report('should have failed') 1105 assert_report('should have failed')
1106 catch /E476:/ 1106 catch /E476:/
1107 v:exception->assert_match('Invalid command: invalid') 1107 v:exception->assert_match('Invalid command: invalid')
1117 # comment 1117 # comment
1118 invalid 1118 invalid
1119 enddef 1119 enddef
1120 defcompile 1120 defcompile
1121 END 1121 END
1122 call writefile(lines, 'Xdef') 1122 writefile(lines, 'Xdef')
1123 try 1123 try
1124 source Xdef 1124 source Xdef
1125 assert_report('should have failed') 1125 assert_report('should have failed')
1126 catch /E476:/ 1126 catch /E476:/
1127 v:exception->assert_match('Invalid command: invalid') 1127 v:exception->assert_match('Invalid command: invalid')
1136 let x = db.asdf 1136 let x = db.asdf
1137 enddef 1137 enddef
1138 defcompile 1138 defcompile
1139 Func() 1139 Func()
1140 END 1140 END
1141 call writefile(lines, 'Xdef') 1141 writefile(lines, 'Xdef')
1142 try 1142 try
1143 source Xdef 1143 source Xdef
1144 assert_report('should have failed') 1144 assert_report('should have failed')
1145 catch /E716:/ 1145 catch /E716:/
1146 v:throwpoint->assert_match('_Func, line 3$') 1146 v:throwpoint->assert_match('_Func, line 3$')
1147 endtry 1147 endtry
1148 1148
1149 call delete('Xdef') 1149 delete('Xdef')
1150 enddef 1150 enddef
1151 1151
1152 def Test_deleted_function() 1152 def Test_deleted_function()
1153 CheckDefExecFailure([ 1153 CheckDefExecFailure([
1154 'let RefMe: func = function("g:DelMe")', 1154 'let RefMe: func = function("g:DelMe")',