diff options
author | Justin M. Keyes <justinkz@gmail.com> | 2022-12-11 21:41:26 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-12-11 18:41:26 -0800 |
commit | 1c324cb1927e03b5a3584a8982e3d5029498f14e (patch) | |
tree | f28365744a6c2a44eec00194a0e443bf008151f9 /test/functional/api/autocmd_spec.lua | |
parent | b12bb97feeb84df47d672d39b2de170061c37f45 (diff) | |
download | rneovim-1c324cb1927e03b5a3584a8982e3d5029498f14e.tar.gz rneovim-1c324cb1927e03b5a3584a8982e3d5029498f14e.tar.bz2 rneovim-1c324cb1927e03b5a3584a8982e3d5029498f14e.zip |
docs #20986
- 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
Diffstat (limited to 'test/functional/api/autocmd_spec.lua')
-rw-r--r-- | test/functional/api/autocmd_spec.lua | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/test/functional/api/autocmd_spec.lua b/test/functional/api/autocmd_spec.lua index a923f5df0e..7fb52b097b 100644 --- a/test/functional/api/autocmd_spec.lua +++ b/test/functional/api/autocmd_spec.lua @@ -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() |