mirror of
https://github.com/vim/vim.git
synced 2025-09-24 03:44:06 -04:00
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)
This commit is contained in:
@@ -2324,11 +2324,12 @@ argidx() Number current index in the argument list
|
|||||||
arglistid([{winnr} [, {tabnr}]]) Number argument list id
|
arglistid([{winnr} [, {tabnr}]]) Number argument list id
|
||||||
argv({nr} [, {winid}]) String {nr} entry of the argument list
|
argv({nr} [, {winid}]) String {nr} entry of the argument list
|
||||||
argv([-1, {winid}]) List the argument list
|
argv([-1, {winid}]) List the argument list
|
||||||
|
asin({expr}) Float arc sine of {expr}
|
||||||
assert_beeps({cmd}) Number assert {cmd} causes a beep
|
assert_beeps({cmd}) Number assert {cmd} causes a beep
|
||||||
assert_equal({exp}, {act} [, {msg}])
|
assert_equal({exp}, {act} [, {msg}])
|
||||||
Number assert {exp} is equal to {act}
|
Number assert {exp} is equal to {act}
|
||||||
assert_equalfile({fname-one}, {fname-two})
|
assert_equalfile({fname-one}, {fname-two} [, {msg}])
|
||||||
Number assert file contents is equal
|
Number assert file contents are equal
|
||||||
assert_exception({error} [, {msg}])
|
assert_exception({error} [, {msg}])
|
||||||
Number assert {error} is in v:exception
|
Number assert {error} is in v:exception
|
||||||
assert_fails({cmd} [, {error} [, {msg}]])
|
assert_fails({cmd} [, {error} [, {msg}]])
|
||||||
|
@@ -263,9 +263,8 @@ assert_equal({expected}, {actual} [, {msg}])
|
|||||||
Can also be used as a |method|: >
|
Can also be used as a |method|: >
|
||||||
mylist->assert_equal([1, 2, 3])
|
mylist->assert_equal([1, 2, 3])
|
||||||
|
|
||||||
|
|
||||||
< *assert_equalfile()*
|
< *assert_equalfile()*
|
||||||
assert_equalfile({fname-one}, {fname-two})
|
assert_equalfile({fname-one}, {fname-two} [, {msg}])
|
||||||
When the files {fname-one} and {fname-two} do not contain
|
When the files {fname-one} and {fname-two} do not contain
|
||||||
exactly the same text an error message is added to |v:errors|.
|
exactly the same text an error message is added to |v:errors|.
|
||||||
Also see |assert-return|.
|
Also see |assert-return|.
|
||||||
@@ -276,7 +275,6 @@ assert_equalfile({fname-one}, {fname-two})
|
|||||||
Can also be used as a |method|: >
|
Can also be used as a |method|: >
|
||||||
GetLog()->assert_equalfile('expected.log')
|
GetLog()->assert_equalfile('expected.log')
|
||||||
|
|
||||||
|
|
||||||
assert_exception({error} [, {msg}]) *assert_exception()*
|
assert_exception({error} [, {msg}]) *assert_exception()*
|
||||||
When v:exception does not contain the string {error} an error
|
When v:exception does not contain the string {error} an error
|
||||||
message is added to |v:errors|. Also see |assert-return|.
|
message is added to |v:errors|. Also see |assert-return|.
|
||||||
|
@@ -419,7 +419,7 @@ static funcentry_T global_functions[] =
|
|||||||
{"asin", 1, 1, FEARG_1, ret_float, FLOAT_FUNC(f_asin)},
|
{"asin", 1, 1, FEARG_1, ret_float, FLOAT_FUNC(f_asin)},
|
||||||
{"assert_beeps", 1, 2, FEARG_1, ret_number, f_assert_beeps},
|
{"assert_beeps", 1, 2, FEARG_1, ret_number, f_assert_beeps},
|
||||||
{"assert_equal", 2, 3, FEARG_2, ret_number, f_assert_equal},
|
{"assert_equal", 2, 3, FEARG_2, ret_number, f_assert_equal},
|
||||||
{"assert_equalfile", 2, 2, FEARG_1, ret_number, f_assert_equalfile},
|
{"assert_equalfile", 2, 3, FEARG_1, ret_number, f_assert_equalfile},
|
||||||
{"assert_exception", 1, 2, 0, ret_number, f_assert_exception},
|
{"assert_exception", 1, 2, 0, ret_number, f_assert_exception},
|
||||||
{"assert_fails", 1, 3, FEARG_1, ret_number, f_assert_fails},
|
{"assert_fails", 1, 3, FEARG_1, ret_number, f_assert_fails},
|
||||||
{"assert_false", 1, 2, FEARG_1, ret_number, f_assert_false},
|
{"assert_false", 1, 2, FEARG_1, ret_number, f_assert_false},
|
||||||
|
@@ -81,6 +81,10 @@ func Test_assert_equalfile()
|
|||||||
call assert_match("difference at byte 4", v:errors[0])
|
call assert_match("difference at byte 4", v:errors[0])
|
||||||
call remove(v:errors, 0)
|
call remove(v:errors, 0)
|
||||||
|
|
||||||
|
call assert_equal(1, assert_equalfile('Xone', 'Xtwo', 'a message'))
|
||||||
|
call assert_match("a message: difference at byte 4", v:errors[0])
|
||||||
|
call remove(v:errors, 0)
|
||||||
|
|
||||||
call delete('Xone')
|
call delete('Xone')
|
||||||
call delete('Xtwo')
|
call delete('Xtwo')
|
||||||
endfunc
|
endfunc
|
||||||
|
@@ -362,6 +362,15 @@ assert_equalfile(typval_T *argvars)
|
|||||||
if (IObuff[0] != NUL)
|
if (IObuff[0] != NUL)
|
||||||
{
|
{
|
||||||
prepare_assert_error(&ga);
|
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);
|
ga_concat(&ga, IObuff);
|
||||||
assert_error(&ga);
|
assert_error(&ga);
|
||||||
ga_clear(&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
|
void
|
||||||
f_assert_equalfile(typval_T *argvars, typval_T *rettv)
|
f_assert_equalfile(typval_T *argvars, typval_T *rettv)
|
||||||
|
@@ -746,6 +746,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
893,
|
||||||
/**/
|
/**/
|
||||||
892,
|
892,
|
||||||
/**/
|
/**/
|
||||||
|
Reference in New Issue
Block a user