unittests: Add tests for tv_dict_extend

This commit is contained in:
ZyX
2017-03-13 14:35:53 +03:00
parent fa852e7cdc
commit 8b9a1fbf7a
3 changed files with 144 additions and 11 deletions

View File

@@ -498,6 +498,16 @@ local function dict_watchers(d)
return ret, qs, key_patterns
end
local function eval0(expr)
local tv = ffi.gc(ffi.new('typval_T', {v_type=eval.VAR_UNKNOWN}),
eval.tv_clear)
if eval.eval0(to_cstr(expr), tv, nil, true) == 0 then
return nil
else
return tv
end
end
return {
int=int,
@@ -540,5 +550,7 @@ return {
tbl2callback=tbl2callback,
callback2tbl=callback2tbl,
eval0=eval0,
empty_list = {[type_key]=list_type},
}