mirror of
https://github.com/neovim/neovim.git
synced 2025-09-06 03:18:16 +00:00
*: Fix test failures
This commit is contained in:
@@ -14545,12 +14545,14 @@ static void f_setline(typval_T *argvars, typval_T *rettv, FunPtr fptr)
|
||||
|
||||
// Default result is zero == OK.
|
||||
for (;; ) {
|
||||
if (argvars[1].v_type == VAR_LIST) {
|
||||
// List argument, get next string.
|
||||
if (li == NULL) {
|
||||
break;
|
||||
}
|
||||
line = tv_get_string_chk(TV_LIST_ITEM_TV(li));
|
||||
li = TV_LIST_ITEM_NEXT(l, li);
|
||||
}
|
||||
|
||||
rettv->vval.v_number = 1; // FAIL
|
||||
if (line == NULL || lnum < 1 || lnum > curbuf->b_ml.ml_line_count + 1) {
|
||||
|
@@ -140,7 +140,9 @@ static int conv_error(const char *const msg, const MPConvStack *const mpstack,
|
||||
? tv_list_last(v.data.l.list)
|
||||
: TV_LIST_ITEM_PREV(v.data.l.list,
|
||||
v.data.l.li));
|
||||
int idx = (int)tv_list_idx_of_item(v.data.l.list, li);
|
||||
int idx = (li == NULL
|
||||
? 0
|
||||
: (int)tv_list_idx_of_item(v.data.l.list, li));
|
||||
if (v.type == kMPConvList
|
||||
|| li == NULL
|
||||
|| (TV_LIST_ITEM_TV(li)->v_type != VAR_LIST
|
||||
|
@@ -2680,6 +2680,7 @@ static bool color_cmdline(CmdlineInfo *colored_ccline)
|
||||
.end = end,
|
||||
.attr = attr,
|
||||
}));
|
||||
i++;
|
||||
});
|
||||
if (prev_end < colored_ccline->cmdlen) {
|
||||
kv_push(ccline_colors->colors, ((CmdlineColorChunk) {
|
||||
|
@@ -628,7 +628,7 @@ describe('msgpackdump() function', function()
|
||||
it('fails to dump a recursive (key) map in a special dict', function()
|
||||
command('let todump = {"_TYPE": v:msgpack_types.map, "_VAL": []}')
|
||||
command('call add(todump._VAL, [todump, 0])')
|
||||
eq('Vim(call):E5005: Unable to dump msgpackdump() argument, index 0: container references itself in index 1',
|
||||
eq('Vim(call):E5005: Unable to dump msgpackdump() argument, index 0: container references itself in index 0',
|
||||
exc_exec('call msgpackdump([todump])'))
|
||||
end)
|
||||
|
||||
|
@@ -114,9 +114,11 @@ describe('063: Test for ":match", "matchadd()" and related functions', function(
|
||||
command("call clearmatches()")
|
||||
eq('\nE714: List required', redir_exec("let rf1 = setmatches(0)"))
|
||||
eq(-1, eval('rf1'))
|
||||
eq('\nE474: Invalid argument', redir_exec("let rf2 = setmatches([0])"))
|
||||
eq('\nE474: List item 0 is either not a dictionary or an empty one',
|
||||
redir_exec("let rf2 = setmatches([0])"))
|
||||
eq(-1, eval('rf2'))
|
||||
eq('\nE474: Invalid argument', redir_exec("let rf3 = setmatches([{'wrong key': 'wrong value'}])"))
|
||||
eq('\nE474: List item 0 is missing one of the required keys',
|
||||
redir_exec("let rf3 = setmatches([{'wrong key': 'wrong value'}])"))
|
||||
eq(-1, eval('rf3'))
|
||||
|
||||
-- Check that "matchaddpos()" positions matches correctly
|
||||
|
Reference in New Issue
Block a user