aboutsummaryrefslogtreecommitdiff
path: root/test/unit/api/private_helpers_spec.lua
diff options
context:
space:
mode:
authorbfredl <bjorn.linse@gmail.com>2024-02-12 20:40:27 +0100
committerbfredl <bjorn.linse@gmail.com>2024-02-15 10:42:06 +0100
commitd60412b18e4e21f301baa2ac3f3fb7be89655e4b (patch)
tree2459531b83b937b6678ee7141badc27d0a331c29 /test/unit/api/private_helpers_spec.lua
parent0a51e7626a95a068c7bb00d0da28a701fed758da (diff)
downloadrneovim-d60412b18e4e21f301baa2ac3f3fb7be89655e4b.tar.gz
rneovim-d60412b18e4e21f301baa2ac3f3fb7be89655e4b.tar.bz2
rneovim-d60412b18e4e21f301baa2ac3f3fb7be89655e4b.zip
refactor(eval): use arena when converting typvals to Object
Note: this contains two _temporary_ changes which can be reverted once the Arena vs no-Arena distinction in API wrappers has been removed. Both nlua_push_Object and object_to_vim_take_luaref() has been changed to take the object argument as a pointer. This is not going to be necessary once these are only used with arena (or not at all) allocated Objects. The object_to_vim() variant which leaves luaref untouched might need to stay for a little longer.
Diffstat (limited to 'test/unit/api/private_helpers_spec.lua')
-rw-r--r--test/unit/api/private_helpers_spec.lua8
1 files changed, 4 insertions, 4 deletions
diff --git a/test/unit/api/private_helpers_spec.lua b/test/unit/api/private_helpers_spec.lua
index 80ca9ddc5b..9843bd5c9e 100644
--- a/test/unit/api/private_helpers_spec.lua
+++ b/test/unit/api/private_helpers_spec.lua
@@ -22,7 +22,7 @@ local api = cimport('./src/nvim/api/private/helpers.h', './src/nvim/api/private/
describe('vim_to_object', function()
local vim_to_object = function(l)
- return obj2lua(api.vim_to_object(lua2typvalt(l)))
+ return obj2lua(api.vim_to_object(lua2typvalt(l), nil, false))
end
local different_output_test = function(name, input, output)
@@ -92,13 +92,13 @@ describe('vim_to_object', function()
itp('outputs empty list for NULL list', function()
local tt = typvalt('VAR_LIST', { v_list = NULL })
eq(nil, tt.vval.v_list)
- eq({ [type_key] = list_type }, obj2lua(api.vim_to_object(tt)))
+ eq({ [type_key] = list_type }, obj2lua(api.vim_to_object(tt, nil, false)))
end)
itp('outputs empty dict for NULL dict', function()
local tt = typvalt('VAR_DICT', { v_dict = NULL })
eq(nil, tt.vval.v_dict)
- eq({}, obj2lua(api.vim_to_object(tt)))
+ eq({}, obj2lua(api.vim_to_object(tt, nil, false)))
end)
itp('regression: partials in a list', function()
@@ -113,6 +113,6 @@ describe('vim_to_object', function()
}
local list = lua2typvalt(llist)
eq(llist, typvalt2lua(list))
- eq({ nil_value, {} }, obj2lua(api.vim_to_object(list)))
+ eq({ nil_value, {} }, obj2lua(api.vim_to_object(list, nil, false)))
end)
end)