unittests: Add tests for tv_list_find*() functions

Additional modifications:

- More `const` qualifiers in tested functions.
- `tv_list_find_str()` second argument is more in-line with other
  `tv_list_find*()` functions.
This commit is contained in:
ZyX
2016-11-04 19:33:36 +03:00
parent b3672ae2fc
commit e5edf07ec4
5 changed files with 204 additions and 8 deletions

View File

@@ -21783,7 +21783,7 @@ void ex_oldfiles(exarg_T *eap)
nr = prompt_for_number(false);
msg_starthere();
if (nr > 0 && nr <= l->lv_len) {
const char *const p = tv_list_find_str(l, nr);
const char *const p = tv_list_find_str(l, nr - 1);
if (p == NULL) {
return;
}