aboutsummaryrefslogtreecommitdiff
path: root/test/unit/garray_spec.lua
diff options
context:
space:
mode:
authorZyX <kp-pav@yandex.ru>2017-03-11 16:02:47 +0300
committerZyX <kp-pav@yandex.ru>2017-03-11 23:23:49 +0300
commite2a578f40dbd4836330402a44844c7ef8a0df5c5 (patch)
treeab2b04b6d0228e7d5a4ef6d611971f063a17be17 /test/unit/garray_spec.lua
parent9400466282918396c814ef456d0f65dca51b8889 (diff)
downloadrneovim-e2a578f40dbd4836330402a44844c7ef8a0df5c5.tar.gz
rneovim-e2a578f40dbd4836330402a44844c7ef8a0df5c5.tar.bz2
rneovim-e2a578f40dbd4836330402a44844c7ef8a0df5c5.zip
unittests: Do not import libnvim or headers in main process
Slows down unit tests much, but gets rid of as much preserved state as possible.
Diffstat (limited to 'test/unit/garray_spec.lua')
-rw-r--r--test/unit/garray_spec.lua4
1 files changed, 2 insertions, 2 deletions
diff --git a/test/unit/garray_spec.lua b/test/unit/garray_spec.lua
index ffa0f15717..28df8a6e3f 100644
--- a/test/unit/garray_spec.lua
+++ b/test/unit/garray_spec.lua
@@ -9,7 +9,7 @@ local ffi = helpers.ffi
local to_cstr = helpers.to_cstr
local NULL = helpers.NULL
-local garray = cimport('stdlib.h', './src/nvim/garray.h')
+local garray = cimport('./src/nvim/garray.h')
local itemsize = 14
local growsize = 95
@@ -157,7 +157,7 @@ local ga_append_ints = function(garr, ...)
end
-- enhanced constructors
-local garray_ctype = ffi.typeof('garray_T[1]')
+local garray_ctype = function(...) return ffi.typeof('garray_T[1]')(...) end
local new_garray = function()
local garr = garray_ctype()
return ffi.gc(garr, ga_clear)