forked from aniani/vim
patch 8.2.4892: test failures because of changed error messages
Problem: Test failures because of changed error messages. Solution: Adjust the exptected error messages.
This commit is contained in:
@@ -141,7 +141,7 @@ func Test_source_sfile()
|
|||||||
if RunVim([], [], '--clean -s Xscript')
|
if RunVim([], [], '--clean -s Xscript')
|
||||||
call assert_equal([
|
call assert_equal([
|
||||||
\ 'E1274: No script file name to substitute for "<script>"',
|
\ 'E1274: No script file name to substitute for "<script>"',
|
||||||
\ 'E498: no :source file name to substitute for "<sfile>"'],
|
\ 'E498: No :source file name to substitute for "<sfile>"'],
|
||||||
\ readfile('Xresult'))
|
\ readfile('Xresult'))
|
||||||
endif
|
endif
|
||||||
call delete('Xscript')
|
call delete('Xscript')
|
||||||
|
@@ -711,7 +711,7 @@ func Test_tcl_exit()
|
|||||||
call assert_fails('tcl exit x', 'expected integer but got "x"')
|
call assert_fails('tcl exit x', 'expected integer but got "x"')
|
||||||
|
|
||||||
tcl set foo "foo"
|
tcl set foo "foo"
|
||||||
call assert_fails('tcl exit 3', 'E572: exit code 3')
|
call assert_fails('tcl exit 3', 'E572: Exit code 3')
|
||||||
|
|
||||||
" The Tcl interpreter should have been deleted and a new one
|
" The Tcl interpreter should have been deleted and a new one
|
||||||
" is re-created with the next :tcl command.
|
" is re-created with the next :tcl command.
|
||||||
|
@@ -293,7 +293,7 @@ def Test_assign_concat()
|
|||||||
var ls: list<string> = []
|
var ls: list<string> = []
|
||||||
ls[-1] ..= 'foo'
|
ls[-1] ..= 'foo'
|
||||||
END
|
END
|
||||||
v9.CheckDefExecAndScriptFailure(lines, 'E684: list index out of range: -1', 2)
|
v9.CheckDefExecAndScriptFailure(lines, 'E684: List index out of range: -1', 2)
|
||||||
enddef
|
enddef
|
||||||
|
|
||||||
def Test_assign_register()
|
def Test_assign_register()
|
||||||
@@ -1641,7 +1641,7 @@ def Test_assign_list()
|
|||||||
l[g:idx : 1] = [0]
|
l[g:idx : 1] = [0]
|
||||||
echo l
|
echo l
|
||||||
END
|
END
|
||||||
v9.CheckDefExecAndScriptFailure(lines, 'E684: list index out of range: 3')
|
v9.CheckDefExecAndScriptFailure(lines, 'E684: List index out of range: 3')
|
||||||
|
|
||||||
lines =<< trim END
|
lines =<< trim END
|
||||||
var l = [1, 2]
|
var l = [1, 2]
|
||||||
|
@@ -2157,7 +2157,7 @@ def Test_job_getchannel()
|
|||||||
CheckFeature job
|
CheckFeature job
|
||||||
else
|
else
|
||||||
v9.CheckDefAndScriptFailure(['job_getchannel("a")'], ['E1013: Argument 1: type mismatch, expected job but got string', 'E1218: Job required for argument 1'])
|
v9.CheckDefAndScriptFailure(['job_getchannel("a")'], ['E1013: Argument 1: type mismatch, expected job but got string', 'E1218: Job required for argument 1'])
|
||||||
assert_fails('job_getchannel(test_null_job())', 'E916: not a valid job')
|
assert_fails('job_getchannel(test_null_job())', 'E916: Not a valid job')
|
||||||
endif
|
endif
|
||||||
enddef
|
enddef
|
||||||
|
|
||||||
@@ -2166,7 +2166,7 @@ def Test_job_info()
|
|||||||
CheckFeature job
|
CheckFeature job
|
||||||
else
|
else
|
||||||
v9.CheckDefAndScriptFailure(['job_info("a")'], ['E1013: Argument 1: type mismatch, expected job but got string', 'E1218: Job required for argument 1'])
|
v9.CheckDefAndScriptFailure(['job_info("a")'], ['E1013: Argument 1: type mismatch, expected job but got string', 'E1218: Job required for argument 1'])
|
||||||
assert_fails('job_info(test_null_job())', 'E916: not a valid job')
|
assert_fails('job_info(test_null_job())', 'E916: Not a valid job')
|
||||||
endif
|
endif
|
||||||
enddef
|
enddef
|
||||||
|
|
||||||
@@ -4071,8 +4071,8 @@ def Test_substitute()
|
|||||||
assert_equal('AX234', res)
|
assert_equal('AX234', res)
|
||||||
|
|
||||||
if has('job')
|
if has('job')
|
||||||
assert_fails('"text"->substitute(".*", () => test_null_job(), "")', 'E908: using an invalid value as a String: job')
|
assert_fails('"text"->substitute(".*", () => test_null_job(), "")', 'E908: Using an invalid value as a String: job')
|
||||||
assert_fails('"text"->substitute(".*", () => test_null_channel(), "")', 'E908: using an invalid value as a String: channel')
|
assert_fails('"text"->substitute(".*", () => test_null_channel(), "")', 'E908: Using an invalid value as a String: channel')
|
||||||
endif
|
endif
|
||||||
v9.CheckDefAndScriptFailure(['substitute(1, "b", "1", "d")'], ['E1013: Argument 1: type mismatch, expected string but got number', 'E1174: String required for argument 1'])
|
v9.CheckDefAndScriptFailure(['substitute(1, "b", "1", "d")'], ['E1013: Argument 1: type mismatch, expected string but got number', 'E1174: String required for argument 1'])
|
||||||
v9.CheckDefAndScriptFailure(['substitute("a", 2, "1", "d")'], ['E1013: Argument 2: type mismatch, expected string but got number', 'E1174: String required for argument 2'])
|
v9.CheckDefAndScriptFailure(['substitute("a", 2, "1", "d")'], ['E1013: Argument 2: type mismatch, expected string but got number', 'E1174: String required for argument 2'])
|
||||||
|
@@ -3114,7 +3114,7 @@ def Test_expr8_any_index_slice()
|
|||||||
v9.CheckDefExecAndScriptFailure(['echo g:testblob[2]'], 'E979:', 1)
|
v9.CheckDefExecAndScriptFailure(['echo g:testblob[2]'], 'E979:', 1)
|
||||||
v9.CheckDefExecAndScriptFailure(['echo g:testblob[-3]'], 'E979:', 1)
|
v9.CheckDefExecAndScriptFailure(['echo g:testblob[-3]'], 'E979:', 1)
|
||||||
|
|
||||||
v9.CheckDefExecAndScriptFailure(['echo g:testlist[4]'], 'E684: list index out of range: 4', 1)
|
v9.CheckDefExecAndScriptFailure(['echo g:testlist[4]'], 'E684: List index out of range: 4', 1)
|
||||||
v9.CheckDefExecAndScriptFailure(['echo g:testlist[-5]'], 'E684:', 1)
|
v9.CheckDefExecAndScriptFailure(['echo g:testlist[-5]'], 'E684:', 1)
|
||||||
|
|
||||||
v9.CheckDefExecAndScriptFailure(['echo g:testdict["a" : "b"]'], 'E719:', 1)
|
v9.CheckDefExecAndScriptFailure(['echo g:testdict["a" : "b"]'], 'E719:', 1)
|
||||||
|
@@ -3709,7 +3709,7 @@ def Run_Test_opfunc_error()
|
|||||||
|
|
||||||
var buf = g:RunVimInTerminal('-S XTest_opfunc_error', {rows: 6, wait_for_ruler: 0})
|
var buf = g:RunVimInTerminal('-S XTest_opfunc_error', {rows: 6, wait_for_ruler: 0})
|
||||||
g:WaitForAssert(() => assert_match('Press ENTER', term_getline(buf, 6)))
|
g:WaitForAssert(() => assert_match('Press ENTER', term_getline(buf, 6)))
|
||||||
g:WaitForAssert(() => assert_match('E684: list index out of range: 0', term_getline(buf, 5)))
|
g:WaitForAssert(() => assert_match('E684: List index out of range: 0', term_getline(buf, 5)))
|
||||||
|
|
||||||
# clean up
|
# clean up
|
||||||
g:StopVimInTerminal(buf)
|
g:StopVimInTerminal(buf)
|
||||||
|
@@ -1527,7 +1527,7 @@ def Test_func_redefine_error()
|
|||||||
source Xtestscript.vim
|
source Xtestscript.vim
|
||||||
catch /E684/
|
catch /E684/
|
||||||
# function name should contain <SNR> every time
|
# function name should contain <SNR> every time
|
||||||
assert_match('E684: list index out of range', v:exception)
|
assert_match('E684: List index out of range', v:exception)
|
||||||
assert_match('function <SNR>\d\+_Func, line 1', v:throwpoint)
|
assert_match('function <SNR>\d\+_Func, line 1', v:throwpoint)
|
||||||
endtry
|
endtry
|
||||||
endfor
|
endfor
|
||||||
|
@@ -3077,7 +3077,7 @@ func Test_nested_if_else_errors()
|
|||||||
endif
|
endif
|
||||||
END
|
END
|
||||||
call writefile(code, 'Xtest')
|
call writefile(code, 'Xtest')
|
||||||
call AssertException(['source Xtest'], 'Vim(else):E583: multiple :else')
|
call AssertException(['source Xtest'], 'Vim(else):E583: Multiple :else')
|
||||||
|
|
||||||
" :elseif after :else
|
" :elseif after :else
|
||||||
let code =<< trim END
|
let code =<< trim END
|
||||||
|
@@ -746,6 +746,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 */
|
||||||
|
/**/
|
||||||
|
4892,
|
||||||
/**/
|
/**/
|
||||||
4891,
|
4891,
|
||||||
/**/
|
/**/
|
||||||
|
Reference in New Issue
Block a user