diff options
author | Bram Moolenaar <Bram@vim.org> | 2018-10-07 20:16:49 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2018-10-07 20:16:49 +0200 |
commit | 1307d1c003b01b4f67524c95feb07c3d91c7c428 (patch) | |
tree | 8c365b3c02351b128d4aea2744f4411425a84b30 /src/eval.c | |
parent | a05a0d325c7615439f4a42f00682b2ebad43c8d9 (diff) |
patch 8.1.0460: assert_fails() does not take a message argumentv8.1.0460
Problem: assert_fails() does not take a message argument
Solution: Add the argument.
Diffstat (limited to 'src/eval.c')
-rw-r--r-- | src/eval.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/eval.c b/src/eval.c index 4f457a457b..8746d55563 100644 --- a/src/eval.c +++ b/src/eval.c @@ -9041,6 +9041,8 @@ assert_fails(typval_T *argvars) char_u *cmd = get_tv_string_chk(&argvars[0]); garray_T ga; int ret = 0; + char_u numbuf[NUMBUFLEN]; + char_u *tofree; called_emsg = FALSE; suppress_errthrow = TRUE; @@ -9050,7 +9052,14 @@ assert_fails(typval_T *argvars) { prepare_assert_error(&ga); ga_concat(&ga, (char_u *)"command did not fail: "); - ga_concat(&ga, cmd); + if (argvars[1].v_type != VAR_UNKNOWN + && argvars[2].v_type != VAR_UNKNOWN) + { + ga_concat(&ga, echo_string(&argvars[2], &tofree, numbuf, 0)); + vim_free(tofree); + } + else + ga_concat(&ga, cmd); assert_error(&ga); ga_clear(&ga); ret = 1; |