Skip to content

Commit

Permalink
patch 8.2.4296: Vim9: not all code covered by tests
Browse files Browse the repository at this point in the history
Problem:    Vim9: not all code covered by tests.
Solution:   Add a few more tests for corner cases.  Fix hang when single quote
            is missing.
  • Loading branch information
brammool committed Feb 4, 2022
1 parent 3e79c97 commit 83d0cec
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 2 deletions.
6 changes: 6 additions & 0 deletions src/testdir/test_vim9_assign.vim
Expand Up @@ -1993,6 +1993,12 @@ def Test_unlet()
assert_false(exists('s:somevar'))
unlet! s:somevar

if 0
unlet g:does_not_exist
endif

v9.CheckDefExecFailure(['unlet v:notfound.key'], 'E1001:')

v9.CheckDefExecFailure([
'var dd = 111',
'unlet dd',
Expand Down
2 changes: 1 addition & 1 deletion src/testdir/test_vim9_cmd.vim
Expand Up @@ -1449,7 +1449,7 @@ def Test_lockvar()
ex = v:exception
endtry
assert_match('E1121:', ex)
unlockvar d.a
unlockvar d['a']
d.a = 7
assert_equal({a: 7, b: 5}, d)

Expand Down
1 change: 1 addition & 0 deletions src/testdir/test_vim9_expr.vim
Expand Up @@ -1833,6 +1833,7 @@ def Test_expr8_string()

v9.CheckDefAndScriptFailure(['var x = "abc'], 'E114:', 1)
v9.CheckDefAndScriptFailure(["var x = 'abc"], 'E115:', 1)
v9.CheckDefFailure(["if 0", "echo 'xx", "endif"], 'E115', 2)
enddef

def Test_expr8_vimvar()
Expand Down
2 changes: 2 additions & 0 deletions src/version.c
Expand Up @@ -746,6 +746,8 @@ static char *(features[]) =

static int included_patches[] =
{ /* Add new patch number below this line */
/**/
4296,
/**/
4295,
/**/
Expand Down
4 changes: 3 additions & 1 deletion src/vim9expr.c
Expand Up @@ -2824,8 +2824,10 @@ compile_expr1(char_u **arg, cctx_T *cctx, ppconst_T *ppconst)
// Ignore all kinds of errors when not producing code.
if (cctx->ctx_skip == SKIP_YES)
{
int prev_did_emsg = did_emsg;

skip_expr_cctx(arg, cctx);
return OK;
return did_emsg == prev_did_emsg ? OK : FAIL;
}

// Evaluate the first expression.
Expand Down

0 comments on commit 83d0cec

Please sign in to comment.