mirror of
https://github.com/neovim/neovim.git
synced 2025-09-20 02:08:17 +00:00
unittests: Test tv_list_copy
Also found some bugs: 1. var_item_copy() always fails to copy v:_null_list and v:_null_dict. Fixing this should mean fixing `deepcopy(v:_null_list)` which should’ve been, but was not listed in #4615. This also fixes `deepcopy(v:_null_dict)`. 2. var_item_copy() crashes when trying to copy NULL string with `conv != NULL`. 3. `conv` argument is ignored when copying list unless `deep` is true, but it was not reflected in documentation. 4. `tv_dict_item_alloc_len()` allocated more memory then needed. 5. typvalt2lua was not able to handle self-referencing containers.
This commit is contained in:
@@ -424,6 +424,7 @@ void tv_list_append_number(list_T *const l, const varnumber_T n)
|
||||
/// Make a copy of list
|
||||
///
|
||||
/// @param[in] conv If non-NULL, then all internal strings will be converted.
|
||||
/// Only used when `deep` is true.
|
||||
/// @param[in] orig Original list to copy.
|
||||
/// @param[in] deep If false, then shallow copy will be done.
|
||||
/// @param[in] copyID See var_item_copy().
|
||||
|
Reference in New Issue
Block a user