diff options
author | ZyX <kp-pav@yandex.ru> | 2017-03-13 14:35:53 +0300 |
---|---|---|
committer | ZyX <kp-pav@yandex.ru> | 2017-03-29 10:08:45 +0300 |
commit | 8b9a1fbf7a630b68b1428a39f25e1fa38fe0cc9f (patch) | |
tree | 97377c62e6c3fe928dee87ddc8486be28c1ea9ae /test/unit/eval/helpers.lua | |
parent | fa852e7cdc365b6fcd39d677f4067963274c44c3 (diff) | |
download | rneovim-8b9a1fbf7a630b68b1428a39f25e1fa38fe0cc9f.tar.gz rneovim-8b9a1fbf7a630b68b1428a39f25e1fa38fe0cc9f.tar.bz2 rneovim-8b9a1fbf7a630b68b1428a39f25e1fa38fe0cc9f.zip |
unittests: Add tests for tv_dict_extend
Diffstat (limited to 'test/unit/eval/helpers.lua')
-rw-r--r-- | test/unit/eval/helpers.lua | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/test/unit/eval/helpers.lua b/test/unit/eval/helpers.lua index 6909953022..a3cb062b7b 100644 --- a/test/unit/eval/helpers.lua +++ b/test/unit/eval/helpers.lua @@ -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}, } |