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:
ZyX 2016-09-25 18:16:17 +03:00
parent 7ceebacb3f
commit cf45c7bb05

View File

@ -606,6 +606,7 @@ describe('typval.c', function()
eq(nil, lib.tv_list_copy(nil, nil, false, 1))
end)
itp('copies list correctly without converting items', function()
do
local v = {{['«']='»'}, {''}, 1, '', null_string, null_list, null_dict}
local l_tv = lua2typvalt(v)
local l = l_tv.vval.v_list
@ -663,6 +664,8 @@ describe('typval.c', function()
a.li(lis_deepcopy1[6]),
a.li(lis_deepcopy1[7]),
})
end
collectgarbage()
end)
itp('copies list correctly and converts items', function()
local vc = ffi.gc(ffi.new('vimconv_T[1]'), function(vc)