diff options
author | ZyX <kp-pav@yandex.ru> | 2016-07-26 23:16:23 +0300 |
---|---|---|
committer | ZyX <kp-pav@yandex.ru> | 2017-03-29 10:05:06 +0300 |
commit | fb146e80aa1ead96518f38b9684e39249bc83485 (patch) | |
tree | 8a157d55108b19ae40cc85817b2620bdcf809905 /test | |
parent | 18e7d552008b92dd3ecd42bf6855530838fd22ab (diff) | |
download | rneovim-fb146e80aa1ead96518f38b9684e39249bc83485.tar.gz rneovim-fb146e80aa1ead96518f38b9684e39249bc83485.tar.bz2 rneovim-fb146e80aa1ead96518f38b9684e39249bc83485.zip |
eval: Split eval.c into smaller files
Diffstat (limited to 'test')
-rw-r--r-- | test/unit/eval/decode_spec.lua | 2 | ||||
-rw-r--r-- | test/unit/eval/helpers.lua | 16 | ||||
-rw-r--r-- | test/unit/eval/tricks_spec.lua | 2 | ||||
-rw-r--r-- | test/unit/eval/tv_clear_spec.lua | 12 |
4 files changed, 16 insertions, 16 deletions
diff --git a/test/unit/eval/decode_spec.lua b/test/unit/eval/decode_spec.lua index 2d7597c0f4..0b2a423cd6 100644 --- a/test/unit/eval/decode_spec.lua +++ b/test/unit/eval/decode_spec.lua @@ -7,7 +7,7 @@ local eq = helpers.eq local neq = helpers.neq local ffi = helpers.ffi -local decode = cimport('./src/nvim/eval/decode.h', './src/nvim/eval_defs.h', +local decode = cimport('./src/nvim/eval/decode.h', './src/nvim/eval/typval.h', './src/nvim/globals.h', './src/nvim/memory.h', './src/nvim/message.h') diff --git a/test/unit/eval/helpers.lua b/test/unit/eval/helpers.lua index 1377d5b501..49f929937f 100644 --- a/test/unit/eval/helpers.lua +++ b/test/unit/eval/helpers.lua @@ -5,7 +5,7 @@ local to_cstr = helpers.to_cstr local ffi = helpers.ffi local eq = helpers.eq -local eval = cimport('./src/nvim/eval.h', './src/nvim/eval_defs.h', +local eval = cimport('./src/nvim/eval.h', './src/nvim/eval/typval.h', './src/nvim/hashtab.h') local null_string = {[true]='NULL string'} @@ -33,7 +33,7 @@ local function li_alloc(nogc) end local function list(...) - local ret = ffi.gc(eval.list_alloc(), eval.list_unref) + local ret = ffi.gc(eval.tv_list_alloc(), eval.tv_list_unref) eq(0, ret.lv_refcount) ret.lv_refcount = 1 for i = 1, select('#', ...) do @@ -241,7 +241,7 @@ local typvalt = function(typ, vval) elseif type(typ) == 'string' then typ = eval[typ] end - return ffi.gc(ffi.new('typval_T', {v_type=typ, vval=vval}), eval.clear_tv) + return ffi.gc(ffi.new('typval_T', {v_type=typ, vval=vval}), eval.tv_clear) end local lua2typvalt_type_tab = { @@ -256,14 +256,14 @@ local lua2typvalt_type_tab = { processed[l].lv_refcount = processed[l].lv_refcount + 1 return typvalt(eval.VAR_LIST, {v_list=processed[l]}) end - local lst = eval.list_alloc() + local lst = eval.tv_list_alloc() lst.lv_refcount = 1 processed[l] = lst local ret = typvalt(eval.VAR_LIST, {v_list=lst}) for i = 1, #l do local item_tv = ffi.gc(lua2typvalt(l[i], processed), nil) - eval.list_append_tv(lst, item_tv) - eval.clear_tv(item_tv) + eval.tv_list_append_tv(lst, item_tv) + eval.tv_clear(item_tv) end return ret end, @@ -281,7 +281,7 @@ local lua2typvalt_type_tab = { local di = eval.dictitem_alloc(to_cstr(k)) local val_tv = ffi.gc(lua2typvalt(v, processed), nil) eval.copy_tv(val_tv, di.di_tv) - eval.clear_tv(val_tv) + eval.tv_clear(val_tv) eval.dict_add(dct, di) end end @@ -301,7 +301,7 @@ local lua2typvalt_type_tab = { for i, arg in ipairs(l.args) do local arg_tv = ffi.gc(lua2typvalt(arg, processed), nil) eval.copy_tv(arg_tv, argv[i - 1]) - eval.clear_tv(arg_tv) + eval.tv_clear(arg_tv) end end local dict = nil diff --git a/test/unit/eval/tricks_spec.lua b/test/unit/eval/tricks_spec.lua index ec79a9cad5..7f0a445f2c 100644 --- a/test/unit/eval/tricks_spec.lua +++ b/test/unit/eval/tricks_spec.lua @@ -10,7 +10,7 @@ local eval = cimport('./src/nvim/eval.h', './src/nvim/memory.h') local eval_expr = function(expr) return ffi.gc(eval.eval_expr(to_cstr(expr), nil), function(tv) - eval.clear_tv(tv) + eval.tv_clear(tv) eval.xfree(tv) end) end diff --git a/test/unit/eval/tv_clear_spec.lua b/test/unit/eval/tv_clear_spec.lua index 47d4661ad8..ca37301b32 100644 --- a/test/unit/eval/tv_clear_spec.lua +++ b/test/unit/eval/tv_clear_spec.lua @@ -14,7 +14,7 @@ local list_items = eval_helpers.list_items local dict_items = eval_helpers.dict_items local lua2typvalt = eval_helpers.lua2typvalt -local lib = cimport('./src/nvim/eval_defs.h', './src/nvim/eval.h') +local lib = cimport('./src/nvim/eval/typval.h', './src/nvim/eval.h') local alloc_log = alloc_log_new() @@ -26,7 +26,7 @@ after_each(function() alloc_log:after_each() end) -describe('clear_tv()', function() +describe('tv_clear()', function() itp('successfully frees all lists in [&l [1], *l, *l]', function() local l_inner = {1} local list = {l_inner, l_inner, l_inner} @@ -44,7 +44,7 @@ describe('clear_tv()', function() a.li(lis[3]), }) eq(3, list_inner_p.lv_refcount) - lib.clear_tv(list_tv) + lib.tv_clear(list_tv) alloc_log:check({ a.freed(lis_inner[1]), a.freed(list_inner_p), @@ -69,7 +69,7 @@ describe('clear_tv()', function() a.li(lis[3]), }) eq(3, list_inner_p.lv_refcount) - lib.clear_tv(list_tv) + lib.tv_clear(list_tv) alloc_log:check({ a.freed(list_inner_p), a.freed(lis[1]), @@ -92,7 +92,7 @@ describe('clear_tv()', function() a.li(lis[2]), }) eq(2, dict_inner_p.dv_refcount) - lib.clear_tv(list_tv) + lib.tv_clear(list_tv) alloc_log:check({ a.freed(dict_inner_p), a.freed(lis[1]), @@ -116,7 +116,7 @@ describe('clear_tv()', function() a.li(lis[2]), }) eq(2, dict_inner_p.dv_refcount) - lib.clear_tv(list_tv) + lib.tv_clear(list_tv) alloc_log:check({ a.freed(dis.a), a.freed(dict_inner_p), |