diff options
author | Justin M. Keyes <justinkz@gmail.com> | 2020-02-18 23:38:52 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-02-18 23:38:52 -0800 |
commit | e8f160c82f8d4809320699630e07a7e5f4537e77 (patch) | |
tree | d4b6c45adac6dc5cffe3623c298da7fdd673fc08 /test/functional/lua/vim_spec.lua | |
parent | 521b79c0f85625f99ff626935484a1225360f820 (diff) | |
parent | f3d4ddd0f8b654d58fb4653d88ac7f652e3ad364 (diff) | |
download | rneovim-e8f160c82f8d4809320699630e07a7e5f4537e77.tar.gz rneovim-e8f160c82f8d4809320699630e07a7e5f4537e77.tar.bz2 rneovim-e8f160c82f8d4809320699630e07a7e5f4537e77.zip |
Merge #11895 'lsp: fix textDocument/completion handling'
Diffstat (limited to 'test/functional/lua/vim_spec.lua')
-rw-r--r-- | test/functional/lua/vim_spec.lua | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/test/functional/lua/vim_spec.lua b/test/functional/lua/vim_spec.lua index ca7c5301ed..2f459145f5 100644 --- a/test/functional/lua/vim_spec.lua +++ b/test/functional/lua/vim_spec.lua @@ -384,6 +384,30 @@ describe('lua stdlib', function() end end) + it('vim.tbl_map', function() + eq({}, exec_lua([[ + return vim.tbl_map(function(v) return v * 2 end, {}) + ]])) + eq({2, 4, 6}, exec_lua([[ + return vim.tbl_map(function(v) return v * 2 end, {1, 2, 3}) + ]])) + eq({{i=2}, {i=4}, {i=6}}, exec_lua([[ + return vim.tbl_map(function(v) return { i = v.i * 2 } end, {{i=1}, {i=2}, {i=3}}) + ]])) + end) + + it('vim.tbl_filter', function() + eq({}, exec_lua([[ + return vim.tbl_filter(function(v) return (v % 2) == 0 end, {}) + ]])) + eq({2}, exec_lua([[ + return vim.tbl_filter(function(v) return (v % 2) == 0 end, {1, 2, 3}) + ]])) + eq({{i=2}}, exec_lua([[ + return vim.tbl_filter(function(v) return (v.i % 2) == 0 end, {{i=1}, {i=2}, {i=3}}) + ]])) + end) + it('vim.tbl_islist', function() eq(true, exec_lua("return vim.tbl_islist({})")) eq(false, exec_lua("return vim.tbl_islist(vim.empty_dict())")) |