mirror of
https://github.com/neovim/neovim.git
synced 2026-07-21 16:41:38 +00:00
fix(api): nvim_create_autocmd crash on invalid types inside pattern array
This commit is contained in:
@@ -613,6 +613,20 @@ describe('autocmd api', function()
|
||||
eq(false, success)
|
||||
matches("'group' must be a string or an integer", code)
|
||||
end)
|
||||
|
||||
it('raises error for invalid pattern array', function()
|
||||
local success, code = unpack(meths.exec_lua([[
|
||||
return {pcall(function()
|
||||
vim.api.nvim_create_autocmd("FileType", {
|
||||
pattern = {{}},
|
||||
command = "echo 'hello'",
|
||||
})
|
||||
end)}
|
||||
]], {}))
|
||||
|
||||
eq(false, success)
|
||||
matches("All entries in 'pattern' must be strings", code)
|
||||
end)
|
||||
end)
|
||||
|
||||
describe('patterns', function()
|
||||
|
||||
Reference in New Issue
Block a user