vim-patch:8.2.0893: assert_equalfile() does not take a third argument

Problem:    Assert_equalfile() does not take a third argument.
Solution:   Implement the third argument. (Gary Johnson)
fb517bac23
This commit is contained in:
Jan Edmund Lazo
2020-07-12 10:17:30 -04:00
parent ab69ea26dc
commit 93f2dc0d03
5 changed files with 16 additions and 6 deletions

View File

@@ -5739,6 +5739,12 @@ int assert_equalfile(typval_T *argvars)
}
if (IObuff[0] != NUL) {
prepare_assert_error(&ga);
if (argvars[2].v_type != VAR_UNKNOWN) {
char *const tofree = encode_tv2echo(&argvars[2], NULL);
ga_concat(&ga, (char_u *)tofree);
xfree(tofree);
ga_concat(&ga, (char_u *)": ");
}
ga_concat(&ga, IObuff);
assert_error(&ga);
ga_clear(&ga);