From e15f61b1bd60f6a198a0d9969cea407784ff71d0 Mon Sep 17 00:00:00 2001 From: Max Date: Mon, 14 Nov 2022 20:26:27 +0100 Subject: fix(lua): make `vim.deepcopy` work with `vim.NIL` style: changed double quotes to single quotes feat: add tests fix tests --- test/functional/lua/vim_spec.lua | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'test/functional/lua/vim_spec.lua') diff --git a/test/functional/lua/vim_spec.lua b/test/functional/lua/vim_spec.lua index 6d0d87746c..21f2c19fbb 100644 --- a/test/functional/lua/vim_spec.lua +++ b/test/functional/lua/vim_spec.lua @@ -419,6 +419,12 @@ describe('lua stdlib', function() return getmetatable(t2) == mt ]])) + ok(exec_lua([[ + local t1 = {a = vim.NIL} + local t2 = vim.deepcopy(t1) + return t2.a == vim.NIL + ]])) + matches('Cannot deepcopy object of type thread', pcall_err(exec_lua, [[ local thread = coroutine.create(function () return 0 end) -- cgit