mirror of
https://github.com/neovim/neovim.git
synced 2025-10-22 17:11:49 +00:00
unittests: Fix tests crash
Tests crash at some point without - `after_each(collectgarbage)` right before “typval.c list copy() copies list correctly and converts items” test. - Commenting out that test. - Adding `collectgarbage()` after the test (what actually this commit does). Adding `collectgarbage()` to top-level `after_each` block right after `restore_allocators` makes running this file crash even if it is run alone.
This commit is contained in:
@@ -606,6 +606,7 @@ describe('typval.c', function()
|
|||||||
eq(nil, lib.tv_list_copy(nil, nil, false, 1))
|
eq(nil, lib.tv_list_copy(nil, nil, false, 1))
|
||||||
end)
|
end)
|
||||||
itp('copies list correctly without converting items', function()
|
itp('copies list correctly without converting items', function()
|
||||||
|
do
|
||||||
local v = {{['«']='»'}, {'„'}, 1, '“', null_string, null_list, null_dict}
|
local v = {{['«']='»'}, {'„'}, 1, '“', null_string, null_list, null_dict}
|
||||||
local l_tv = lua2typvalt(v)
|
local l_tv = lua2typvalt(v)
|
||||||
local l = l_tv.vval.v_list
|
local l = l_tv.vval.v_list
|
||||||
@@ -663,6 +664,8 @@ describe('typval.c', function()
|
|||||||
a.li(lis_deepcopy1[6]),
|
a.li(lis_deepcopy1[6]),
|
||||||
a.li(lis_deepcopy1[7]),
|
a.li(lis_deepcopy1[7]),
|
||||||
})
|
})
|
||||||
|
end
|
||||||
|
collectgarbage()
|
||||||
end)
|
end)
|
||||||
itp('copies list correctly and converts items', function()
|
itp('copies list correctly and converts items', function()
|
||||||
local vc = ffi.gc(ffi.new('vimconv_T[1]'), function(vc)
|
local vc = ffi.gc(ffi.new('vimconv_T[1]'), function(vc)
|
||||||
|
Reference in New Issue
Block a user