diff options
author | ZyX <kp-pav@yandex.ru> | 2017-03-05 01:26:26 +0300 |
---|---|---|
committer | ZyX <kp-pav@yandex.ru> | 2017-03-29 10:08:45 +0300 |
commit | 6c622ed08bb56f08f4cc4dbf6251220ccf7ba2ba (patch) | |
tree | 60156602fba434b14582d69a6d7f430dec2e05a2 /test/unit/eval/helpers.lua | |
parent | ffaf7c7521399826d9a32b12a1180bcd162f88be (diff) | |
download | rneovim-6c622ed08bb56f08f4cc4dbf6251220ccf7ba2ba.tar.gz rneovim-6c622ed08bb56f08f4cc4dbf6251220ccf7ba2ba.tar.bz2 rneovim-6c622ed08bb56f08f4cc4dbf6251220ccf7ba2ba.zip |
unittests: Add tv_dict_item_{add,remove} tests
Diffstat (limited to 'test/unit/eval/helpers.lua')
-rw-r--r-- | test/unit/eval/helpers.lua | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/test/unit/eval/helpers.lua b/test/unit/eval/helpers.lua index 21ef51ff20..8faa8dbf5c 100644 --- a/test/unit/eval/helpers.lua +++ b/test/unit/eval/helpers.lua @@ -416,7 +416,10 @@ local alloc_logging_helpers = { -- lua_…: allocated by this file, not by some Neovim function lua_pt = function(pt) return {func='calloc', args={1, ffi.sizeof('partial_T')}, ret=void(pt)} end, - lua_tvs = function(argv, argc) return {func='malloc', args={ffi.sizeof('typval_T')*argc}, ret=void(argv)} end, + lua_tvs = function(argv, argc) + argc = alloc_len(argc) + return {func='malloc', args={ffi.sizeof('typval_T')*argc}, ret=void(argv)} + end, } local function int(n) @@ -430,7 +433,7 @@ end local function dict(d) return populate_dict(ffi.gc(eval.tv_dict_alloc(), eval.tv_dict_free), - d, {}) + d or {}, {}) end local callback2tbl_type_tab = nil |