aboutsummaryrefslogtreecommitdiff
path: root/test/functional/lua_spec.lua
diff options
context:
space:
mode:
authorZyX <kp-pav@yandex.ru>2016-07-12 19:04:12 +0300
committerZyX <kp-pav@yandex.ru>2017-03-27 00:11:26 +0300
commit3fa4ca81880bc5113c32a89de965ce593e9b001f (patch)
treea687ac7acbb3df805af9a21c2c1530b4767a840a /test/functional/lua_spec.lua
parented3115bd26047c9b125798d9cb56d09b155a243b (diff)
downloadrneovim-3fa4ca81880bc5113c32a89de965ce593e9b001f.tar.gz
rneovim-3fa4ca81880bc5113c32a89de965ce593e9b001f.tar.bz2
rneovim-3fa4ca81880bc5113c32a89de965ce593e9b001f.zip
executor/converter: Fix conversion of self-containing containers
Diffstat (limited to 'test/functional/lua_spec.lua')
-rw-r--r--test/functional/lua_spec.lua27
1 files changed, 19 insertions, 8 deletions
diff --git a/test/functional/lua_spec.lua b/test/functional/lua_spec.lua
index 4f00189519..5c6dee90a3 100644
--- a/test/functional/lua_spec.lua
+++ b/test/functional/lua_spec.lua
@@ -224,12 +224,23 @@ describe('luaeval() function', function()
eq(10, funcs.luaeval('vim.api._vim_id({[vim.type_idx]=vim.types.float, [vim.val_idx]=10, [5]=1, foo=2, [1]=42})'))
end)
-- TODO: check what happens when it errors out on second list item
---[[FIXME
- [
- [ it('correctly converts self-containing containers', function()
- [ meths.set_var('l', {})
- [ eval('add(l, l)')
- [ eq(true, eval('luaeval("_A == _A[1]", l)'))
- [ end)
- ]]
+ -- TODO: check what happens if API function receives wrong number of
+ -- arguments.
+ -- TODO: check what happens if API function receives wrong argument types.
+
+ it('correctly converts self-containing containers', function()
+ meths.set_var('l', {})
+ eval('add(l, l)')
+ eq(true, eval('luaeval("_A == _A[1]", l)'))
+ eq(true, eval('luaeval("_A[1] == _A[1][1]", [l])'))
+ eq(true, eval('luaeval("_A.d == _A.d[1]", {"d": l})'))
+ eq(true, eval('luaeval("_A ~= _A[1]", [l])'))
+
+ meths.set_var('d', {foo=42})
+ eval('extend(d, {"d": d})')
+ eq(true, eval('luaeval("_A == _A.d", d)'))
+ eq(true, eval('luaeval("_A[1] == _A[1].d", [d])'))
+ eq(true, eval('luaeval("_A.d == _A.d.d", {"d": d})'))
+ eq(true, eval('luaeval("_A ~= _A.d", {"d": d})'))
+ end)
end)