Problem: Vim9: not all code covered by tests.
Solution: Add a few more tests for corner cases. Fix hang when single quote
is missing.
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',
ex = v:exception
endtry
assert_match('E1121:', ex)
- unlockvar d.a
+ unlockvar d['a']
d.a = 7
assert_equal({a: 7, b: 5}, d)
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()
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 4296,
/**/
4295,
/**/
// 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.