vim-patch:partial:8.2.3335: Vim9: not enough tests run with Vim9

Problem:    Vim9: not enough tests run with Vim9.
Solution:   Run a few more tests in Vim9 script and :def function.  Fix that
            items(), keys() and values9) return zero for a NULL dict.
            Make join() return an empty string for a NULL list.  Make sort()
            return an empty list for a NULL list.

ef98257593

Skip f_reverse() change for consistency with other functions.
Skip Test_null_list() and Test_null_dict() because of missing patches.

Co-authored-by: Bram Moolenaar <Bram@vim.org>
This commit is contained in:
zeertzjq
2023-06-12 16:15:12 +08:00
parent 8d8ac15ed9
commit 4058f95d9d
2 changed files with 140 additions and 111 deletions

View File

@@ -3019,11 +3019,12 @@ static void tv_dict_list(typval_T *const tv, typval_T *const rettv, const DictLi
emsg(_(e_dictreq));
return;
}
if (tv->vval.v_dict == NULL) {
return;
}
tv_list_alloc_ret(rettv, tv_dict_len(tv->vval.v_dict));
if (tv->vval.v_dict == NULL) {
// NULL dict behaves like an empty dict
return;
}
TV_DICT_ITER(tv->vval.v_dict, di, {
typval_T tv_item = { .v_lock = VAR_UNLOCKED };