forked from aniani/vim
patch 8.2.4296: Vim9: not all code covered by tests
Problem: Vim9: not all code covered by tests. Solution: Add a few more tests for corner cases. Fix hang when single quote is missing.
This commit is contained in:
parent
3e79c97c18
commit
83d0cec956
@ -1993,6 +1993,12 @@ def Test_unlet()
|
|||||||
assert_false(exists('s:somevar'))
|
assert_false(exists('s:somevar'))
|
||||||
unlet! s:somevar
|
unlet! s:somevar
|
||||||
|
|
||||||
|
if 0
|
||||||
|
unlet g:does_not_exist
|
||||||
|
endif
|
||||||
|
|
||||||
|
v9.CheckDefExecFailure(['unlet v:notfound.key'], 'E1001:')
|
||||||
|
|
||||||
v9.CheckDefExecFailure([
|
v9.CheckDefExecFailure([
|
||||||
'var dd = 111',
|
'var dd = 111',
|
||||||
'unlet dd',
|
'unlet dd',
|
||||||
|
@ -1449,7 +1449,7 @@ def Test_lockvar()
|
|||||||
ex = v:exception
|
ex = v:exception
|
||||||
endtry
|
endtry
|
||||||
assert_match('E1121:', ex)
|
assert_match('E1121:', ex)
|
||||||
unlockvar d.a
|
unlockvar d['a']
|
||||||
d.a = 7
|
d.a = 7
|
||||||
assert_equal({a: 7, b: 5}, d)
|
assert_equal({a: 7, b: 5}, d)
|
||||||
|
|
||||||
|
@ -1833,6 +1833,7 @@ def Test_expr8_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)
|
||||||
enddef
|
enddef
|
||||||
|
|
||||||
def Test_expr8_vimvar()
|
def Test_expr8_vimvar()
|
||||||
|
@ -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 */
|
||||||
|
/**/
|
||||||
|
4296,
|
||||||
/**/
|
/**/
|
||||||
4295,
|
4295,
|
||||||
/**/
|
/**/
|
||||||
|
@ -2824,8 +2824,10 @@ compile_expr1(char_u **arg, cctx_T *cctx, ppconst_T *ppconst)
|
|||||||
// Ignore all kinds of errors when not producing code.
|
// Ignore all kinds of errors when not producing code.
|
||||||
if (cctx->ctx_skip == SKIP_YES)
|
if (cctx->ctx_skip == SKIP_YES)
|
||||||
{
|
{
|
||||||
|
int prev_did_emsg = did_emsg;
|
||||||
|
|
||||||
skip_expr_cctx(arg, cctx);
|
skip_expr_cctx(arg, cctx);
|
||||||
return OK;
|
return did_emsg == prev_did_emsg ? OK : FAIL;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Evaluate the first expression.
|
// Evaluate the first expression.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user