diff options
| author | Josh Rahm <joshuarahm@gmail.com> | 2024-11-19 22:57:13 +0000 |
|---|---|---|
| committer | Josh Rahm <joshuarahm@gmail.com> | 2024-11-19 22:57:13 +0000 |
| commit | 9be89f131f87608f224f0ee06d199fcd09d32176 (patch) | |
| tree | 11022dcfa9e08cb4ac5581b16734196128688d48 /src/nvim/testing.c | |
| parent | ff7ed8f586589d620a806c3758fac4a47a8e7e15 (diff) | |
| parent | 88085c2e80a7e3ac29aabb6b5420377eed99b8b6 (diff) | |
| download | rneovim-9be89f131f87608f224f0ee06d199fcd09d32176.tar.gz rneovim-9be89f131f87608f224f0ee06d199fcd09d32176.tar.bz2 rneovim-9be89f131f87608f224f0ee06d199fcd09d32176.zip | |
Merge remote-tracking branch 'upstream/master' into mix_20240309
Diffstat (limited to 'src/nvim/testing.c')
| -rw-r--r-- | src/nvim/testing.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/nvim/testing.c b/src/nvim/testing.c index 343568d71e..adbdd3e611 100644 --- a/src/nvim/testing.c +++ b/src/nvim/testing.c @@ -7,6 +7,7 @@ #include <string.h> #include "nvim/ascii_defs.h" +#include "nvim/errors.h" #include "nvim/eval.h" #include "nvim/eval/encode.h" #include "nvim/eval/typval.h" @@ -129,7 +130,7 @@ static void ga_concat_shorten_esc(garray_T *gap, const char *str) return; } - for (const char *p = str; *p != NUL; p++) { + for (const char *p = str; *p != NUL;) { int same_len = 1; const char *s = p; const int c = mb_cptr2char_adv(&s); @@ -145,9 +146,10 @@ static void ga_concat_shorten_esc(garray_T *gap, const char *str) vim_snprintf(buf, NUMBUFLEN, "%d", same_len); ga_concat(gap, buf); ga_concat(gap, " times]"); - p = s - 1; + p = s; } else { ga_concat_esc(gap, p, clen); + p += clen; } } } @@ -197,7 +199,7 @@ static void fill_assert_error(garray_T *gap, typval_T *opt_msg_tv, const char *e if (!HASHITEM_EMPTY(hi)) { dictitem_T *item2 = tv_dict_find(got_d, hi->hi_key, -1); if (item2 == NULL - || !tv_equal(&TV_DICT_HI2DI(hi)->di_tv, &item2->di_tv, false, false)) { + || !tv_equal(&TV_DICT_HI2DI(hi)->di_tv, &item2->di_tv, false)) { // item of exp_d not present in got_d or values differ. const size_t key_len = strlen(hi->hi_key); tv_dict_add_tv(exp_tv->vval.v_dict, hi->hi_key, key_len, &TV_DICT_HI2DI(hi)->di_tv); @@ -270,8 +272,7 @@ static int assert_equal_common(typval_T *argvars, assert_type_T atype) { garray_T ga; - if (tv_equal(&argvars[0], &argvars[1], false, false) - != (atype == ASSERT_EQUAL)) { + if (tv_equal(&argvars[0], &argvars[1], false) != (atype == ASSERT_EQUAL)) { prepare_assert_error(&ga); fill_assert_error(&ga, &argvars[2], NULL, &argvars[0], &argvars[1], atype); |