diff options
author | James McCoy <jamessan@jamessan.com> | 2017-01-06 21:11:33 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-01-06 21:11:33 -0500 |
commit | b4c0c61f5caa22962ba94981dece4be8bf8a2c26 (patch) | |
tree | 6cd369e366182d25388377136e04370846573473 /test/unit/api/private_helpers_spec.lua | |
parent | 1fee9a7151b30435947475fb410029397725f2ac (diff) | |
parent | dd48d7b94b8a0f5b4612a3821330d508d5b4241c (diff) | |
download | rneovim-b4c0c61f5caa22962ba94981dece4be8bf8a2c26.tar.gz rneovim-b4c0c61f5caa22962ba94981dece4be8bf8a2c26.tar.bz2 rneovim-b4c0c61f5caa22962ba94981dece4be8bf8a2c26.zip |
Merge pull request #5826 from ZyX-I/fix-typval_encode
Refactor eval/typval_encode.h
Diffstat (limited to 'test/unit/api/private_helpers_spec.lua')
-rw-r--r-- | test/unit/api/private_helpers_spec.lua | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/test/unit/api/private_helpers_spec.lua b/test/unit/api/private_helpers_spec.lua index 1d7c03787b..8c54ea6a2a 100644 --- a/test/unit/api/private_helpers_spec.lua +++ b/test/unit/api/private_helpers_spec.lua @@ -7,6 +7,7 @@ local NULL = helpers.NULL local eq = helpers.eq local lua2typvalt = eval_helpers.lua2typvalt +local typvalt2lua = eval_helpers.typvalt2lua local typvalt = eval_helpers.typvalt local nil_value = api_helpers.nil_value @@ -14,6 +15,7 @@ local list_type = api_helpers.list_type local int_type = api_helpers.int_type local type_key = api_helpers.type_key local obj2lua = api_helpers.obj2lua +local func_type = api_helpers.func_type local api = cimport('./src/nvim/api/private/helpers.h') @@ -85,4 +87,19 @@ describe('vim_to_object', function() eq(nil, tt.vval.v_dict) eq({}, obj2lua(api.vim_to_object(tt))) end) + + it('regression: partials in a list', function() + local llist = { + { + [type_key]=func_type, + value='printf', + args={'%s'}, + dict={v=1}, + }, + {}, + } + local list = lua2typvalt(llist) + eq(llist, typvalt2lua(list)) + eq({nil_value, {}}, obj2lua(api.vim_to_object(list))) + end) end) |