diff options
author | James McCoy <jamessan@jamessan.com> | 2017-04-05 22:39:40 -0400 |
---|---|---|
committer | James McCoy <jamessan@jamessan.com> | 2017-04-05 22:39:40 -0400 |
commit | bb54d921aaf85f0393c1ba10585560056f7f4ec8 (patch) | |
tree | 316ff7424337b3572b58340383eeabb3a0d36e80 /test/unit/eval/tricks_spec.lua | |
parent | 4f69a8fb8854698adb2de8956ad0d86ff35a6f68 (diff) | |
parent | 210b013ce75b5ea8a897071e32decc1e1f88189e (diff) | |
download | rneovim-bb54d921aaf85f0393c1ba10585560056f7f4ec8.tar.gz rneovim-bb54d921aaf85f0393c1ba10585560056f7f4ec8.tar.bz2 rneovim-bb54d921aaf85f0393c1ba10585560056f7f4ec8.zip |
Merge remote-tracking branch 'origin/master' into vim-7.4.2170
Diffstat (limited to 'test/unit/eval/tricks_spec.lua')
-rw-r--r-- | test/unit/eval/tricks_spec.lua | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/test/unit/eval/tricks_spec.lua b/test/unit/eval/tricks_spec.lua index ec79a9cad5..7aa0f0f6e6 100644 --- a/test/unit/eval/tricks_spec.lua +++ b/test/unit/eval/tricks_spec.lua @@ -1,19 +1,15 @@ local helpers = require('test.unit.helpers')(after_each) +local eval_helpers = require('test.unit.eval.helpers') + local itp = helpers.gen_itp(it) local cimport = helpers.cimport -local to_cstr = helpers.to_cstr -local ffi = helpers.ffi local eq = helpers.eq -local eval = cimport('./src/nvim/eval.h', './src/nvim/memory.h') +local eval0 = eval_helpers.eval0 -local eval_expr = function(expr) - return ffi.gc(eval.eval_expr(to_cstr(expr), nil), function(tv) - eval.clear_tv(tv) - eval.xfree(tv) - end) -end +local eval = cimport('./src/nvim/eval.h', './src/nvim/eval/typval.h', + './src/nvim/memory.h') describe('NULL typval_T', function() itp('is produced by $XXX_UNEXISTENT_VAR_XXX', function() @@ -25,19 +21,19 @@ describe('NULL typval_T', function() while os.getenv(unexistent_env) ~= nil do unexistent_env = unexistent_env .. '_XXX' end - local rettv = eval_expr('$' .. unexistent_env) + local rettv = eval0('$' .. unexistent_env) eq(eval.VAR_STRING, rettv.v_type) eq(nil, rettv.vval.v_string) end) itp('is produced by v:_null_list', function() - local rettv = eval_expr('v:_null_list') + local rettv = eval0('v:_null_list') eq(eval.VAR_LIST, rettv.v_type) eq(nil, rettv.vval.v_list) end) itp('is produced by v:_null_dict', function() - local rettv = eval_expr('v:_null_dict') + local rettv = eval0('v:_null_dict') eq(eval.VAR_DICT, rettv.v_type) eq(nil, rettv.vval.v_dict) end) |