patch 8.2.4484: Vim9: some error messages are not tested
Problem: Vim9: some error messages are not tested.
Solution: Add a few more test cases. Delete dead code.
diff --git a/src/vim9execute.c b/src/vim9execute.c
index beca9e7..a7b76c6 100644
--- a/src/vim9execute.c
+++ b/src/vim9execute.c
@@ -1027,7 +1027,7 @@
{
int func_idx = find_internal_func(name);
- if (func_idx < 0)
+ if (func_idx < 0) // Impossible?
return FAIL;
if (check_internal_func(func_idx, argcount) < 0)
return FAIL;
@@ -1452,8 +1452,6 @@
char_u *p;
char_u *line;
- if (*sp->nextline == NUL)
- return NULL;
p = vim_strchr(sp->nextline, '\n');
if (p == NULL)
{
@@ -1911,11 +1909,11 @@
else
n2 = (long)tv_get_number_chk(tv_idx2, &error);
if (error)
- status = FAIL;
+ status = FAIL; // cannot happen?
else
{
listitem_T *li1 = check_range_index_one(
- tv_dest->vval.v_list, &n1, FALSE);
+ tv_dest->vval.v_list, &n1, FALSE);
if (li1 == NULL)
status = FAIL;