mirror of
https://github.com/neovim/neovim.git
synced 2025-09-11 13:58:18 +00:00
vim-patch:8.2.3421: a bit of code is not covered by tests (#19895)
Problem: A bit of code is not covered by tests.
Solution: Add a few more test cases. (Dominique Pellé, closes vim/vim#8857)
d176ca3dde
Cherry-pick Test_trim() change from patch 8.2.0448.
Cherry-pick Test_History() change from patch 8.2.1736.
Cherry-pick charidx() and trim() type checks from patch 8.2.3135.
This commit is contained in:
@@ -874,7 +874,8 @@ static void f_charidx(typval_T *argvars, typval_T *rettv, FunPtr fptr)
|
||||
if (argvars[0].v_type != VAR_STRING
|
||||
|| argvars[1].v_type != VAR_NUMBER
|
||||
|| (argvars[2].v_type != VAR_UNKNOWN
|
||||
&& argvars[2].v_type != VAR_NUMBER)) {
|
||||
&& argvars[2].v_type != VAR_NUMBER
|
||||
&& argvars[2].v_type != VAR_BOOL)) {
|
||||
emsg(_(e_invarg));
|
||||
return;
|
||||
}
|
||||
@@ -9460,6 +9461,11 @@ static void f_trim(typval_T *argvars, typval_T *rettv, FunPtr fptr)
|
||||
return;
|
||||
}
|
||||
|
||||
if (argvars[1].v_type != VAR_UNKNOWN && argvars[1].v_type != VAR_STRING) {
|
||||
semsg(_(e_invarg2), tv_get_string(&argvars[1]));
|
||||
return;
|
||||
}
|
||||
|
||||
if (argvars[1].v_type == VAR_STRING) {
|
||||
mask = (const char_u *)tv_get_string_buf_chk(&argvars[1], buf2);
|
||||
if (argvars[2].v_type != VAR_UNKNOWN) {
|
||||
|
Reference in New Issue
Block a user