summaryrefslogtreecommitdiffstats
path: root/src/testing.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2020-06-03 19:55:35 +0200
committerBram Moolenaar <Bram@vim.org>2020-06-03 19:55:35 +0200
commitfb517bac2384798bb5142ed1f75f965f93984c0a (patch)
tree44d7bd1442dfa1af46844cbe84a099bd87eb2007 /src/testing.c
parentc5acc0f7fed6b061d994fc5ac660dcc0312750bd (diff)
patch 8.2.0893: assert_equalfile() does not take a third argumentv8.2.0893
Problem: Assert_equalfile() does not take a third argument. Solution: Implement the third argument. (Gary Johnson)
Diffstat (limited to 'src/testing.c')
-rw-r--r--src/testing.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/testing.c b/src/testing.c
index 604d39b74c..fa8cc42418 100644
--- a/src/testing.c
+++ b/src/testing.c
@@ -362,6 +362,15 @@ assert_equalfile(typval_T *argvars)
if (IObuff[0] != NUL)
{
prepare_assert_error(&ga);
+ if (argvars[2].v_type != VAR_UNKNOWN)
+ {
+ char_u numbuf[NUMBUFLEN];
+ char_u *tofree;
+
+ ga_concat(&ga, echo_string(&argvars[2], &tofree, numbuf, 0));
+ vim_free(tofree);
+ ga_concat(&ga, (char_u *)": ");
+ }
ga_concat(&ga, IObuff);
assert_error(&ga);
ga_clear(&ga);
@@ -371,7 +380,7 @@ assert_equalfile(typval_T *argvars)
}
/*
- * "assert_equalfile(fname-one, fname-two)" function
+ * "assert_equalfile(fname-one, fname-two[, msg])" function
*/
void
f_assert_equalfile(typval_T *argvars, typval_T *rettv)