vim-patch:8.2.0829: filter() may give misleading error message

Problem:    filter() may give misleading error message.
Solution:   Also mention Blob as an allowed argument.
fcb0b61d15

Rename Test_map_fails() to Test_map_filter_fails() from v8.2.0610 and
include the modeline.
This commit is contained in:
Sean Dewar 2021-07-29 21:40:30 +01:00
parent 19232593ba
commit ffaf881b42
No known key found for this signature in database
GPG Key ID: 08CC2C83AD41B581
2 changed files with 6 additions and 2 deletions

View File

@ -6393,7 +6393,7 @@ void filter_map(typval_T *argvars, typval_T *rettv, int map)
return;
}
} else {
EMSG2(_(e_listdictarg), ermsg);
EMSG2(_(e_listdictblobarg), ermsg);
return;
}

View File

@ -81,7 +81,11 @@ func Test_filter_map_dict_expr_funcref()
call assert_equal({"foo": "f", "bar": "b", "baz": "b"}, map(copy(dict), function('s:filter4')))
endfunc
func Test_map_fails()
func Test_map_filter_fails()
call assert_fails('call map([1], "42 +")', 'E15:')
call assert_fails('call filter([1], "42 +")', 'E15:')
call assert_fails("let l = map('abc', '\"> \" . v:val')", 'E896:')
call assert_fails("let l = filter('abc', '\"> \" . v:val')", 'E896:')
endfunc
" vim: shiftwidth=2 sts=2 expandtab