summaryrefslogtreecommitdiff
path: root/src/testing.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2020-10-28 20:20:00 +0100
committerBram Moolenaar <Bram@vim.org>2020-10-28 20:20:00 +0100
commit28ee892ac4197421b3317f195512ca64cc56a5b4 (patch)
tree0a9eb799ec0e55a32600cc604cea653d9b91f322 /src/testing.c
parent3e2534ed1a6557445747e6c1439ad26ec8eabfc4 (diff)
downloadvim-git-28ee892ac4197421b3317f195512ca64cc56a5b4.tar.gz
patch 8.2.1919: assert_fails() setting emsg_silent changes normal executionv8.2.1919
Problem: Assert_fails() setting emsg_silent changes normal execution. Solution: Use a separate flag in_assert_fails.
Diffstat (limited to 'src/testing.c')
-rw-r--r--src/testing.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/testing.c b/src/testing.c
index 811544103..919b91182 100644
--- a/src/testing.c
+++ b/src/testing.c
@@ -555,8 +555,7 @@ f_assert_fails(typval_T *argvars, typval_T *rettv)
// trylevel must be zero for a ":throw" command to be considered failed
trylevel = 0;
suppress_errthrow = TRUE;
- emsg_silent = TRUE;
- emsg_assert_fails_used = TRUE;
+ in_assert_fails = TRUE;
do_cmdline_cmd(cmd);
if (called_emsg == called_emsg_before)
@@ -679,9 +678,13 @@ f_assert_fails(typval_T *argvars, typval_T *rettv)
theend:
trylevel = save_trylevel;
suppress_errthrow = FALSE;
- emsg_silent = FALSE;
+ in_assert_fails = FALSE;
+ did_emsg = FALSE;
+ msg_col = 0;
+ need_wait_return = FALSE;
emsg_on_display = FALSE;
- emsg_assert_fails_used = FALSE;
+ msg_scrolled = 0;
+ lines_left = Rows;
VIM_CLEAR(emsg_assert_fails_msg);
set_vim_var_string(VV_ERRMSG, NULL, 0);
if (wrong_arg_msg != NULL)