- https://github.com/neovim/tree-sitter-vimdoc v1.2.4 eliminates most
  errors in pi_netrw.txt, so we can remove that workaround from
  ignore_parse_error().
- improved codeblock
This commit is contained in:
Justin M. Keyes
2022-12-11 21:41:26 -05:00
committed by GitHub
parent b12bb97fee
commit 1c324cb192
13 changed files with 156 additions and 195 deletions

View File

@@ -14,14 +14,14 @@ before_each(clear)
describe('autocmd api', function()
describe('nvim_create_autocmd', function()
it('does not allow "command" and "callback" in the same autocmd', function()
local ok, _ = pcall(meths.create_autocmd, "BufReadPost", {
it('"command" and "callback" are mutually exclusive', function()
local rv = pcall_err(meths.create_autocmd, "BufReadPost", {
pattern = "*.py,*.pyi",
command = "echo 'Should Have Errored",
callback = "not allowed",
callback = "NotAllowed",
})
eq(false, ok)
eq("specify either 'callback' or 'command', not both", rv)
end)
it('doesnt leak when you use ++once', function()
@@ -60,13 +60,13 @@ describe('autocmd api', function()
end)
it('does not allow passing buffer and patterns', function()
local ok = pcall(meths.create_autocmd, "Filetype", {
local rv = pcall_err(meths.create_autocmd, "Filetype", {
command = "let g:called = g:called + 1",
buffer = 0,
pattern = "*.py",
})
eq(false, ok)
eq("cannot pass both: 'pattern' and 'buffer' for the same autocmd", rv)
end)
it('does not allow passing invalid buffers', function()