test(lua): tbl_deep_extend "after second argument" #30297

This commit is contained in:
Justin M. Keyes 2024-09-07 09:41:02 -07:00 committed by GitHub
parent 3d1110674e
commit 5ddf2ab768
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1079,34 +1079,21 @@ describe('lua stdlib', function()
return vim.deep_equal(c, { sub = { [1] = 'a', b = 'a' } })
]]))
matches(
'invalid "behavior": nil',
pcall_err(
exec_lua,
[[
return vim.tbl_deep_extend()
]]
)
)
matches('invalid "behavior": nil', pcall_err(exec_lua, [[return vim.tbl_deep_extend()]]))
matches(
'wrong number of arguments %(given 1, expected at least 3%)',
pcall_err(
exec_lua,
[[
return vim.tbl_deep_extend("keep")
]]
)
pcall_err(exec_lua, [[return vim.tbl_deep_extend("keep")]])
)
matches(
'wrong number of arguments %(given 2, expected at least 3%)',
pcall_err(
exec_lua,
[[
return vim.tbl_deep_extend("keep", {})
]]
)
pcall_err(exec_lua, [[return vim.tbl_deep_extend("keep", {})]])
)
matches(
'after the second argument%: expected table, got number',
pcall_err(exec_lua, [[return vim.tbl_deep_extend("keep", {}, 42)]])
)
end)