0
0
mirror of https://github.com/vim/vim.git synced 2025-10-01 04:54:07 -04:00

patch 8.2.0487: Vim9: compiling not sufficiently tested

Problem:    Vim9: compiling not sufficiently tested.
Solution:   Add more tests.  Fix bug with PCALL.
This commit is contained in:
Bram Moolenaar
2020-03-31 23:13:10 +02:00
parent 9be61bbb17
commit bd5da371aa
6 changed files with 72 additions and 22 deletions

View File

@@ -260,9 +260,10 @@ func TakesOneArg(arg)
echo a:arg
endfunc
def Test_call_wrong_arg_count()
def Test_call_wrong_args()
call CheckDefFailure(['TakesOneArg()'], 'E119:')
call CheckDefFailure(['TakesOneArg(11, 22)'], 'E118:')
call CheckDefFailure(['bufnr(xxx)'], 'E1001:')
enddef
" Default arg and varargs
@@ -1029,6 +1030,14 @@ def Test_while_loop()
assert_equal('1_3_', result)
enddef
def Test_for_loop_fails()
call CheckDefFailure(['for # in range(5)'], 'E690:')
call CheckDefFailure(['for i In range(5)'], 'E690:')
call CheckDefFailure(['let x = 5', 'for x in range(5)'], 'E1023:')
call CheckScriptFailure(['def Func(arg)', 'for arg in range(5)', 'enddef'], 'E1006:')
call CheckDefFailure(['for i in "text"'], 'E1024:')
enddef
def Test_interrupt_loop()
let caught = false
let x = 0