0
0
mirror of https://github.com/vim/vim.git synced 2025-07-24 10:45:12 -04:00

patch 9.1.1325: tests: not checking error numbers properly

Problem:  tests: not checking error numbers properly.
Solution: Add a trailing comma to avoid matching a different error
          number with the same prefix (zeertzjq)

closes: #17159

Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
zeertzjq 2025-04-20 10:21:18 +02:00 committed by Christian Brabandt
parent 2398460232
commit 67fe77d272
No known key found for this signature in database
GPG Key ID: F3F92DA383FDDE09
17 changed files with 72 additions and 70 deletions

View File

@ -640,7 +640,7 @@ endfunc
func Test_clear_arglist_in_all() func Test_clear_arglist_in_all()
n 0 00 000 0000 00000 000000 n 0 00 000 0000 00000 000000
au WinNew 0 n 0 au WinNew 0 n 0
call assert_fails("all", "E1156") call assert_fails("all", "E1156:")
au! * au! *
endfunc endfunc

View File

@ -3661,9 +3661,9 @@ func Test_autocmd_normal_mess()
augroup aucmd_normal_test augroup aucmd_normal_test
au BufLeave,BufWinLeave,BufHidden,BufUnload,BufDelete,BufWipeout * norm 7q/qc au BufLeave,BufWinLeave,BufHidden,BufUnload,BufDelete,BufWipeout * norm 7q/qc
augroup END augroup END
call assert_fails('o4', 'E1159') call assert_fails('o4', 'E1159:')
silent! H silent! H
call assert_fails('e xx', 'E1159') call assert_fails('e xx', 'E1159:')
normal G normal G
augroup aucmd_normal_test augroup aucmd_normal_test
@ -5078,32 +5078,32 @@ func Test_autocmd_tabclosedpre()
" Close tab in TabClosedPre autocmd " Close tab in TabClosedPre autocmd
call ClearAutomcdAndCreateTabs() call ClearAutomcdAndCreateTabs()
au TabClosedPre * tabclose au TabClosedPre * tabclose
call assert_fails('tabclose', 'E1312') call assert_fails('tabclose', 'E1312:')
call ClearAutomcdAndCreateTabs() call ClearAutomcdAndCreateTabs()
au TabClosedPre * tabclose au TabClosedPre * tabclose
call assert_fails('tabclose 2', 'E1312') call assert_fails('tabclose 2', 'E1312:')
call ClearAutomcdAndCreateTabs() call ClearAutomcdAndCreateTabs()
au TabClosedPre * tabclose 1 au TabClosedPre * tabclose 1
call assert_fails('tabclose', 'E1312') call assert_fails('tabclose', 'E1312:')
" Close other (all) tabs in TabClosedPre autocmd " Close other (all) tabs in TabClosedPre autocmd
call ClearAutomcdAndCreateTabs() call ClearAutomcdAndCreateTabs()
au TabClosedPre * tabonly au TabClosedPre * tabonly
call assert_fails('tabclose', 'E1312') call assert_fails('tabclose', 'E1312:')
call ClearAutomcdAndCreateTabs() call ClearAutomcdAndCreateTabs()
au TabClosedPre * tabonly au TabClosedPre * tabonly
call assert_fails('tabclose 2', 'E1312') call assert_fails('tabclose 2', 'E1312:')
call ClearAutomcdAndCreateTabs() call ClearAutomcdAndCreateTabs()
au TabClosedPre * tabclose 4 au TabClosedPre * tabclose 4
call assert_fails('tabclose 2', 'E1312') call assert_fails('tabclose 2', 'E1312:')
" Open new tabs in TabClosedPre autocmd " Open new tabs in TabClosedPre autocmd
call ClearAutomcdAndCreateTabs() call ClearAutomcdAndCreateTabs()
au TabClosedPre * tabnew D au TabClosedPre * tabnew D
call assert_fails('tabclose', 'E1312') call assert_fails('tabclose', 'E1312:')
call ClearAutomcdAndCreateTabs() call ClearAutomcdAndCreateTabs()
au TabClosedPre * tabnew D au TabClosedPre * tabnew D
call assert_fails('tabclose 1', 'E1312') call assert_fails('tabclose 1', 'E1312:')
" Moving the tab page in TabClosedPre autocmd " Moving the tab page in TabClosedPre autocmd
call ClearAutomcdAndCreateTabs() call ClearAutomcdAndCreateTabs()
@ -5132,10 +5132,10 @@ func Test_autocmd_tabclosedpre()
" Create new windows in TabClosedPre autocmd " Create new windows in TabClosedPre autocmd
call ClearAutomcdAndCreateTabs() call ClearAutomcdAndCreateTabs()
au TabClosedPre * split | e X| vsplit | e Y | split | e Z au TabClosedPre * split | e X| vsplit | e Y | split | e Z
call assert_fails('tabclose', 'E242') call assert_fails('tabclose', 'E242:')
call ClearAutomcdAndCreateTabs() call ClearAutomcdAndCreateTabs()
au TabClosedPre * new X | new Y | new Z au TabClosedPre * new X | new Y | new Z
call assert_fails('tabclose 1', 'E242') call assert_fails('tabclose 1', 'E242:')
" Test directly closing the tab page with ':tabclose' " Test directly closing the tab page with ':tabclose'
au! au!

View File

@ -240,13 +240,13 @@ func Test_blob_compare()
VAR b1 = 0z0011 VAR b1 = 0z0011
echo b1 == 9 echo b1 == 9
END END
call v9.CheckLegacyAndVim9Failure(lines, ['E977:', 'E1072', 'E1072']) call v9.CheckLegacyAndVim9Failure(lines, ['E977:', 'E1072:', 'E1072:'])
let lines =<< trim END let lines =<< trim END
VAR b1 = 0z0011 VAR b1 = 0z0011
echo b1 != 9 echo b1 != 9
END END
call v9.CheckLegacyAndVim9Failure(lines, ['E977:', 'E1072', 'E1072']) call v9.CheckLegacyAndVim9Failure(lines, ['E977:', 'E1072:', 'E1072:'])
let lines =<< trim END let lines =<< trim END
VAR b1 = 0z0011 VAR b1 = 0z0011

View File

@ -344,7 +344,7 @@ func Test_uncrypt_xchacha20_3_persistent_undo()
" should fail " should fail
norm! u norm! u
call assert_match('Already at oldest change', execute(':1mess')) call assert_match('Already at oldest change', execute(':1mess'))
call assert_fails('verbose rundo ' .. fnameescape(ufile), 'E822') call assert_fails('verbose rundo ' .. fnameescape(ufile), 'E822:')
bw! bw!
set undolevels& cryptmethod& undofile& set undolevels& cryptmethod& undofile&
call delete('Xcrypt_sodium_undo.txt') call delete('Xcrypt_sodium_undo.txt')
@ -357,8 +357,8 @@ func Test_encrypt_xchacha20_missing()
return return
endif endif
sp Xcrypt_sodium_undo.txt sp Xcrypt_sodium_undo.txt
call assert_fails(':set cryptmethod=xchacha20', 'E474') call assert_fails(':set cryptmethod=xchacha20', 'E474:')
call assert_fails(':set cryptmethod=xchacha20v2', 'E474') call assert_fails(':set cryptmethod=xchacha20v2', 'E474:')
bw! bw!
set cm& set cm&
endfunc endfunc

View File

@ -2083,7 +2083,7 @@ endfunc
func Test_read_invalid() func Test_read_invalid()
set encoding=latin1 set encoding=latin1
" This was not properly checking for going past the end. " This was not properly checking for going past the end.
call assert_fails('r`=', 'E484') call assert_fails('r`=', 'E484:')
set encoding=utf-8 set encoding=utf-8
endfunc endfunc

View File

@ -257,10 +257,10 @@ func Test_method_with_prefix()
call v9.CheckLegacyAndVim9Success(lines) call v9.CheckLegacyAndVim9Success(lines)
call assert_equal([0, 1, 2], --3->range()) call assert_equal([0, 1, 2], --3->range())
call v9.CheckDefAndScriptFailure(['eval --3->range()'], 'E15') call v9.CheckDefAndScriptFailure(['eval --3->range()'], 'E15:')
call assert_equal(1, !+-+0) call assert_equal(1, !+-+0)
call v9.CheckDefAndScriptFailure(['eval !+-+0'], 'E15') call v9.CheckDefAndScriptFailure(['eval !+-+0'], 'E15:')
endfunc endfunc
func Test_option_value() func Test_option_value()
@ -874,7 +874,7 @@ endfunc
" Test for errors in expression evaluation " Test for errors in expression evaluation
func Test_expr_eval_error() func Test_expr_eval_error()
call v9.CheckLegacyAndVim9Failure(["VAR i = 'abc' .. []"], ['E730:', 'E1105:', 'E730:']) call v9.CheckLegacyAndVim9Failure(["VAR i = 'abc' .. []"], ['E730:', 'E1105:', 'E730:'])
call v9.CheckLegacyAndVim9Failure(["VAR l = [] + 10"], ['E745:', 'E1051:', 'E745']) call v9.CheckLegacyAndVim9Failure(["VAR l = [] + 10"], ['E745:', 'E1051:', 'E745:'])
call v9.CheckLegacyAndVim9Failure(["VAR v = 10 + []"], ['E745:', 'E1051:', 'E745:']) call v9.CheckLegacyAndVim9Failure(["VAR v = 10 + []"], ['E745:', 'E1051:', 'E745:'])
call v9.CheckLegacyAndVim9Failure(["VAR v = 10 / []"], ['E745:', 'E1036:', 'E745:']) call v9.CheckLegacyAndVim9Failure(["VAR v = 10 / []"], ['E745:', 'E1036:', 'E745:'])
call v9.CheckLegacyAndVim9Failure(["VAR v = -{}"], ['E728:', 'E1012:', 'E728:']) call v9.CheckLegacyAndVim9Failure(["VAR v = -{}"], ['E728:', 'E1012:', 'E728:'])

View File

@ -1147,13 +1147,13 @@ func Test_undo_ftplugin_on_buffer_reuse()
enew enew
bw defaults.vim bw defaults.vim
let b:undo_ftplugin = ':bw' let b:undo_ftplugin = ':bw'
call assert_fails(':e $VIMRUNTIME/defaults.vim', 'E937') call assert_fails(':e $VIMRUNTIME/defaults.vim', 'E937:')
" try to split the window " try to split the window
enew enew
bw defaults.vim bw defaults.vim
let b:undo_ftplugin = ':sp $VIMRUNTIME/defaults.vim' let b:undo_ftplugin = ':sp $VIMRUNTIME/defaults.vim'
call assert_fails(':e $VIMRUNTIME/defaults.vim', 'E242') call assert_fails(':e $VIMRUNTIME/defaults.vim', 'E242:')
bwipe! bwipe!
filetype off filetype off

View File

@ -1412,7 +1412,7 @@ func Test_listdict_index()
call v9.CheckLegacyAndVim9Failure(['VAR d = {"k": 10}', 'echo d[1 : 2]'], 'E719:') call v9.CheckLegacyAndVim9Failure(['VAR d = {"k": 10}', 'echo d[1 : 2]'], 'E719:')
call assert_fails("let v = [4, 6][{-> 1}]", 'E729:') call assert_fails("let v = [4, 6][{-> 1}]", 'E729:')
call v9.CheckDefAndScriptFailure(['var v = [4, 6][() => 1]'], ['E1012', 'E703:']) call v9.CheckDefAndScriptFailure(['var v = [4, 6][() => 1]'], ['E1012:', 'E703:'])
call v9.CheckLegacyAndVim9Failure(['VAR v = range(5)[2 : []]'], ['E730:', 'E1012:', 'E730:']) call v9.CheckLegacyAndVim9Failure(['VAR v = range(5)[2 : []]'], ['E730:', 'E1012:', 'E730:'])

View File

@ -277,11 +277,11 @@ func Test_complete()
set complete=.,w,b,u,k,\ s,i,d,],t,U,f,o set complete=.,w,b,u,k,\ s,i,d,],t,U,f,o
call assert_fails('set complete=i^-10', 'E535:') call assert_fails('set complete=i^-10', 'E535:')
call assert_fails('set complete=i^x', 'E535:') call assert_fails('set complete=i^x', 'E535:')
call assert_fails('set complete=k^2,t^-1,s^', 'E535') call assert_fails('set complete=k^2,t^-1,s^', 'E535:')
call assert_fails('set complete=t^-1', 'E535') call assert_fails('set complete=t^-1', 'E535:')
call assert_fails('set complete=kfoo^foo2', 'E535') call assert_fails('set complete=kfoo^foo2', 'E535:')
call assert_fails('set complete=kfoo^', 'E535') call assert_fails('set complete=kfoo^', 'E535:')
call assert_fails('set complete=.^', 'E535') call assert_fails('set complete=.^', 'E535:')
set complete=.,w,b,u,k,s,i,d,],t,U,f,o set complete=.,w,b,u,k,s,i,d,],t,U,f,o
set complete=. set complete=.
set complete=.^10,t^0 set complete=.^10,t^0

View File

@ -1441,7 +1441,7 @@ func Test_cq_zero_exmode()
let logfile = 'Xcq_log.txt' let logfile = 'Xcq_log.txt'
let out = system(GetVimCommand() .. ' --clean --log ' .. logfile .. ' -es -X -c "argdelete foobar" -c"7cq"') let out = system(GetVimCommand() .. ' --clean --log ' .. logfile .. ' -es -X -c "argdelete foobar" -c"7cq"')
call assert_equal(8, v:shell_error) call assert_equal(8, v:shell_error)
let log = filter(readfile(logfile), {idx, val -> val =~ "E480"}) let log = filter(readfile(logfile), {idx, val -> val =~ "E480:"})
call assert_match('E480: No match: foobar', log[0]) call assert_match('E480: No match: foobar', log[0])
call delete(logfile) call delete(logfile)
@ -1452,7 +1452,7 @@ func Test_cq_zero_exmode()
else else
call assert_equal(256, v:shell_error) call assert_equal(256, v:shell_error)
endif endif
let log = filter(readfile(logfile), {idx, val -> val =~ "E480"}) let log = filter(readfile(logfile), {idx, val -> val =~ "E480:"})
call assert_match('E480: No match: foobar', log[0]) call assert_match('E480: No match: foobar', log[0])
call delete('Xcq_log.txt') call delete('Xcq_log.txt')
endfunc endfunc

View File

@ -1850,7 +1850,7 @@ func T75_R()
Xpath 'f' Xpath 'f'
finally finally
Xpath 'g' Xpath 'g'
if caught || $VIMNOERRTHROW && v:errmsg =~ 'E21' if caught || $VIMNOERRTHROW && v:errmsg =~ 'E21:'
Xpath 'h' Xpath 'h'
endif endif
break " discard error for $VIMNOERRTHROW break " discard error for $VIMNOERRTHROW
@ -1877,7 +1877,7 @@ func Test_builtin_func_error()
Xpath 'k' Xpath 'k'
finally finally
Xpath 'l' Xpath 'l'
if caught || $VIMNOERRTHROW && v:errmsg =~ 'E21' if caught || $VIMNOERRTHROW && v:errmsg =~ 'E21:'
Xpath 'm' Xpath 'm'
endif endif
break " discard error for $VIMNOERRTHROW break " discard error for $VIMNOERRTHROW
@ -1896,7 +1896,7 @@ func Test_builtin_func_error()
Xpath 'o' Xpath 'o'
finally finally
Xpath 'p' Xpath 'p'
if caught || $VIMNOERRTHROW && v:errmsg =~ 'E21' if caught || $VIMNOERRTHROW && v:errmsg =~ 'E21:'
Xpath 'q' Xpath 'q'
endif endif
break " discard error for $VIMNOERRTHROW break " discard error for $VIMNOERRTHROW
@ -1915,7 +1915,7 @@ func Test_builtin_func_error()
Xpath 's' Xpath 's'
finally finally
Xpath 't' Xpath 't'
if caught || $VIMNOERRTHROW && v:errmsg =~ 'E21' if caught || $VIMNOERRTHROW && v:errmsg =~ 'E21:'
Xpath 'u' Xpath 'u'
endif endif
break " discard error for $VIMNOERRTHROW break " discard error for $VIMNOERRTHROW
@ -1938,7 +1938,7 @@ func Test_builtin_func_error()
Xpath 'x' Xpath 'x'
finally finally
Xpath 'y' Xpath 'y'
if caught || $VIMNOERRTHROW && v:errmsg =~ 'E21' if caught || $VIMNOERRTHROW && v:errmsg =~ 'E21:'
Xpath 'z' Xpath 'z'
endif endif
break " discard error for $VIMNOERRTHROW break " discard error for $VIMNOERRTHROW
@ -1958,7 +1958,7 @@ func Test_builtin_func_error()
Xpath 'B' Xpath 'B'
finally finally
Xpath 'C' Xpath 'C'
if caught || $VIMNOERRTHROW && v:errmsg =~ 'E21' if caught || $VIMNOERRTHROW && v:errmsg =~ 'E21:'
Xpath 'D' Xpath 'D'
endif endif
call assert_equal('a', x) call assert_equal('a', x)

View File

@ -326,13 +326,13 @@ func Test_CmdErrors()
vim9script vim9script
com! -complete=file DoCmd : com! -complete=file DoCmd :
END END
call v9.CheckScriptFailure(lines, 'E1208', 2) call v9.CheckScriptFailure(lines, 'E1208:', 2)
let lines =<< trim END let lines =<< trim END
vim9script vim9script
com! -nargs=0 -complete=file DoCmd : com! -nargs=0 -complete=file DoCmd :
END END
call v9.CheckScriptFailure(lines, 'E1208', 2) call v9.CheckScriptFailure(lines, 'E1208:', 2)
com! -nargs=0 DoCmd : com! -nargs=0 DoCmd :
call assert_fails('DoCmd x', 'E488:') call assert_fails('DoCmd x', 'E488:')

View File

@ -383,7 +383,7 @@ def Test_type_with_extra_white()
var lines =<< trim END var lines =<< trim END
const x : number = 3 const x : number = 3
END END
v9.CheckDefExecAndScriptFailure(lines, 'E1059') v9.CheckDefExecAndScriptFailure(lines, 'E1059:')
enddef enddef
def Test_keep_type_after_assigning_null() def Test_keep_type_after_assigning_null()
@ -532,8 +532,8 @@ def Test_assign_unpack()
lines =<< trim END lines =<< trim END
[v1, v2] = [1, 2] [v1, v2] = [1, 2]
END END
v9.CheckDefFailure(lines, 'E1089', 1) v9.CheckDefFailure(lines, 'E1089:', 1)
v9.CheckScriptFailure(['vim9script'] + lines, 'E1089', 2) v9.CheckScriptFailure(['vim9script'] + lines, 'E1089:', 2)
lines =<< trim END lines =<< trim END
var v1: number var v1: number

View File

@ -1037,7 +1037,7 @@ def Test_execute()
v9.CheckSourceDefAndScriptFailure(['execute(123)'], ['E1013: Argument 1: type mismatch, expected string but got number', 'E1222: String or List required for argument 1']) v9.CheckSourceDefAndScriptFailure(['execute(123)'], ['E1013: Argument 1: type mismatch, expected string but got number', 'E1222: String or List required for argument 1'])
v9.CheckSourceDefFailure(['execute([123])'], 'E1013: Argument 1: type mismatch, expected list<string> but got list<number>') v9.CheckSourceDefFailure(['execute([123])'], 'E1013: Argument 1: type mismatch, expected list<string> but got list<number>')
v9.CheckSourceDefExecFailure(['echo execute(["xx", 123])'], 'E492') v9.CheckSourceDefExecFailure(['echo execute(["xx", 123])'], 'E492:')
v9.CheckSourceDefAndScriptFailure(['execute("xx", 123)'], ['E1013: Argument 2: type mismatch, expected string but got number', 'E1174: String required for argument 2']) v9.CheckSourceDefAndScriptFailure(['execute("xx", 123)'], ['E1013: Argument 2: type mismatch, expected string but got number', 'E1174: String required for argument 2'])
enddef enddef

View File

@ -1705,7 +1705,7 @@ def Test_lockvar()
enddef enddef
SetList() SetList()
END END
v9.CheckScriptFailure(lines, 'E1119', 4) v9.CheckScriptFailure(lines, 'E1119:', 4)
lines =<< trim END lines =<< trim END
vim9script vim9script
@ -1716,7 +1716,7 @@ def Test_lockvar()
enddef enddef
AddToList() AddToList()
END END
v9.CheckScriptFailure(lines, 'E741', 2) v9.CheckScriptFailure(lines, 'E741:', 2)
lines =<< trim END lines =<< trim END
vim9script vim9script
@ -1727,7 +1727,7 @@ def Test_lockvar()
enddef enddef
AddToList() AddToList()
END END
v9.CheckScriptFailure(lines, 'E741', 2) v9.CheckScriptFailure(lines, 'E741:', 2)
# can unlet a locked list item but not change it # can unlet a locked list item but not change it
lines =<< trim END lines =<< trim END
@ -1742,7 +1742,7 @@ def Test_lockvar()
lockvar ll[1] lockvar ll[1]
ll[1] = 9 ll[1] = 9
END END
v9.CheckDefExecAndScriptFailure(lines, ['E1119:', 'E741'], 3) v9.CheckDefExecAndScriptFailure(lines, ['E1119:', 'E741:'], 3)
# can unlet a locked dict item but not change it # can unlet a locked dict item but not change it
lines =<< trim END lines =<< trim END
@ -1757,26 +1757,26 @@ def Test_lockvar()
lockvar dd.a lockvar dd.a
dd.a = 3 dd.a = 3
END END
v9.CheckDefExecAndScriptFailure(lines, ['E1121:', 'E741'], 3) v9.CheckDefExecAndScriptFailure(lines, ['E1121:', 'E741:'], 3)
lines =<< trim END lines =<< trim END
var theList = [1, 2, 3] var theList = [1, 2, 3]
lockvar theList lockvar theList
END END
v9.CheckDefFailure(lines, 'E1178', 2) v9.CheckDefFailure(lines, 'E1178:', 2)
lines =<< trim END lines =<< trim END
var theList = [1, 2, 3] var theList = [1, 2, 3]
unlockvar theList unlockvar theList
END END
v9.CheckDefFailure(lines, 'E1178', 2) v9.CheckDefFailure(lines, 'E1178:', 2)
lines =<< trim END lines =<< trim END
vim9script vim9script
var name = 'john' var name = 'john'
lockvar nameX lockvar nameX
END END
v9.CheckScriptFailure(lines, 'E1246', 3) v9.CheckScriptFailure(lines, 'E1246:', 3)
lines =<< trim END lines =<< trim END
vim9script vim9script
@ -1786,14 +1786,14 @@ def Test_lockvar()
enddef enddef
LockIt() LockIt()
END END
v9.CheckScriptFailure(lines, 'E1246', 1) v9.CheckScriptFailure(lines, 'E1246:', 1)
lines =<< trim END lines =<< trim END
vim9script vim9script
const name = 'john' const name = 'john'
unlockvar name unlockvar name
END END
v9.CheckScriptFailure(lines, 'E46', 3) v9.CheckScriptFailure(lines, 'E46:', 3)
lines =<< trim END lines =<< trim END
vim9script vim9script
@ -1803,7 +1803,7 @@ def Test_lockvar()
enddef enddef
UnLockIt() UnLockIt()
END END
v9.CheckScriptFailure(lines, 'E46', 1) v9.CheckScriptFailure(lines, 'E46:', 1)
lines =<< trim END lines =<< trim END
def _() def _()
@ -1811,7 +1811,7 @@ def Test_lockvar()
enddef enddef
defcomp defcomp
END END
v9.CheckScriptFailure(lines, 'E179', 1) v9.CheckScriptFailure(lines, 'E179:', 1)
lines =<< trim END lines =<< trim END
def T() def T()
@ -1819,7 +1819,7 @@ def Test_lockvar()
enddef enddef
defcomp defcomp
END END
v9.CheckScriptFailure(lines, 'E179', 1) v9.CheckScriptFailure(lines, 'E179:', 1)
enddef enddef
def Test_substitute_expr() def Test_substitute_expr()

View File

@ -712,7 +712,7 @@ def Test_expr4_equal()
v9.CheckDefExecAndScriptFailure(['var x: any = "a"', 'echo x == true'], 'E1072: Cannot compare string with bool', 2) v9.CheckDefExecAndScriptFailure(['var x: any = "a"', 'echo x == true'], 'E1072: Cannot compare string with bool', 2)
v9.CheckDefExecAndScriptFailure(["var x: any = true", 'echo x == ""'], 'E1072: Cannot compare bool with string', 2) v9.CheckDefExecAndScriptFailure(["var x: any = true", 'echo x == ""'], 'E1072: Cannot compare bool with string', 2)
v9.CheckDefExecAndScriptFailure(["var x: any = 99", 'echo x == true'], ['E1138', 'E1072:'], 2) v9.CheckDefExecAndScriptFailure(["var x: any = 99", 'echo x == true'], ['E1138:', 'E1072:'], 2)
v9.CheckDefExecAndScriptFailure(["var x: any = 'a'", 'echo x == 99'], ['E1030:', 'E1072:'], 2) v9.CheckDefExecAndScriptFailure(["var x: any = 'a'", 'echo x == 99'], ['E1030:', 'E1072:'], 2)
lines =<< trim END lines =<< trim END
@ -1610,7 +1610,7 @@ def Test_expr6_vim9script()
lines =<< trim END lines =<< trim END
echo 0z1234 - 44 echo 0z1234 - 44
END END
v9.CheckDefAndScriptFailure(lines, ['E1036', 'E974:'], 1) v9.CheckDefAndScriptFailure(lines, ['E1036:', 'E974:'], 1)
lines =<< trim END lines =<< trim END
echo 'abc' is? 'abc' echo 'abc' is? 'abc'
@ -1865,8 +1865,8 @@ def Test_expr7()
v9.CheckDefFailure(["var d = 6 * "], 'E1097:', 3) v9.CheckDefFailure(["var d = 6 * "], 'E1097:', 3)
v9.CheckScriptFailure(['vim9script', "var d = 6 * "], 'E15:', 2) v9.CheckScriptFailure(['vim9script', "var d = 6 * "], 'E15:', 2)
v9.CheckDefAndScriptFailure(['echo 1 / 0'], 'E1154', 1) v9.CheckDefAndScriptFailure(['echo 1 / 0'], 'E1154:', 1)
v9.CheckDefAndScriptFailure(['echo 1 % 0'], 'E1154', 1) v9.CheckDefAndScriptFailure(['echo 1 % 0'], 'E1154:', 1)
g:zero = 0 g:zero = 0
v9.CheckDefExecFailure(['echo 123 / g:zero'], 'E1154: Divide by zero') v9.CheckDefExecFailure(['echo 123 / g:zero'], 'E1154: Divide by zero')
@ -1876,19 +1876,19 @@ def Test_expr7()
'g:one = 1.0', 'g:one = 1.0',
'g:two = 2.0', 'g:two = 2.0',
'echo g:one % g:two', 'echo g:one % g:two',
], 'E804', 3) ], 'E804:', 3)
lines =<< trim END lines =<< trim END
var n = 0 var n = 0
eval 1 / n eval 1 / n
END END
v9.CheckDefExecAndScriptFailure(lines, 'E1154', 2) v9.CheckDefExecAndScriptFailure(lines, 'E1154:', 2)
lines =<< trim END lines =<< trim END
var n = 0 var n = 0
eval 1 % n eval 1 % n
END END
v9.CheckDefExecAndScriptFailure(lines, 'E1154', 2) v9.CheckDefExecAndScriptFailure(lines, 'E1154:', 2)
enddef enddef
def Test_expr7_vim9script() def Test_expr7_vim9script()
@ -2185,7 +2185,7 @@ def Test_expr9_string()
v9.CheckDefAndScriptFailure(['var x = "abc'], 'E114:', 1) v9.CheckDefAndScriptFailure(['var x = "abc'], 'E114:', 1)
v9.CheckDefAndScriptFailure(["var x = 'abc"], 'E115:', 1) v9.CheckDefAndScriptFailure(["var x = 'abc"], 'E115:', 1)
v9.CheckDefFailure(["if 0", "echo 'xx", "endif"], 'E115', 2) v9.CheckDefFailure(["if 0", "echo 'xx", "endif"], 'E115:', 2)
# interpolated string # interpolated string
var val = 'val' var val = 'val'
@ -2556,28 +2556,28 @@ def Test_expr9_lambda_block()
lines =<< trim END lines =<< trim END
map([1, 2], (k, v) => { redrawt }) map([1, 2], (k, v) => { redrawt })
END END
v9.CheckDefAndScriptFailure(lines, 'E488') v9.CheckDefAndScriptFailure(lines, 'E488:')
lines =<< trim END lines =<< trim END
var Func = (nr: int) => { var Func = (nr: int) => {
echo nr echo nr
} }
END END
v9.CheckDefAndScriptFailure(lines, 'E1010', 1) v9.CheckDefAndScriptFailure(lines, 'E1010:', 1)
lines =<< trim END lines =<< trim END
var Func = (nr: number): int => { var Func = (nr: number): int => {
return nr return nr
} }
END END
v9.CheckDefAndScriptFailure(lines, 'E1010', 1) v9.CheckDefAndScriptFailure(lines, 'E1010:', 1)
lines =<< trim END lines =<< trim END
var Func = (nr: number): int => { var Func = (nr: number): int => {
return nr return nr
END END
v9.CheckDefFailure(lines, 'E1171', 0) # line nr is function start v9.CheckDefFailure(lines, 'E1171:', 0) # line nr is function start
v9.CheckScriptFailure(['vim9script'] + lines, 'E1171', 2) v9.CheckScriptFailure(['vim9script'] + lines, 'E1171:', 2)
lines =<< trim END lines =<< trim END
var Func = (nr: number): int => { var Func = (nr: number): int => {

View File

@ -704,6 +704,8 @@ static char *(features[]) =
static int included_patches[] = static int included_patches[] =
{ /* Add new patch number below this line */ { /* Add new patch number below this line */
/**/
1325,
/**/ /**/
1324, 1324,
/**/ /**/