diff options
author | Justin M. Keyes <justinkz@gmail.com> | 2019-09-03 22:51:45 +0200 |
---|---|---|
committer | Justin M. Keyes <justinkz@gmail.com> | 2019-09-06 17:19:07 -0700 |
commit | af946046b922dc5d5285a70a23d11916d8389a5d (patch) | |
tree | 090d68a1dd675b5ad6e99abc829be0daafe2a7d9 /test/functional/autocmd/autocmd_spec.lua | |
parent | 638f2b6dee7439de303bea12dec80240617e8034 (diff) | |
download | rneovim-af946046b922dc5d5285a70a23d11916d8389a5d.tar.gz rneovim-af946046b922dc5d5285a70a23d11916d8389a5d.tar.bz2 rneovim-af946046b922dc5d5285a70a23d11916d8389a5d.zip |
test: Rename meth_pcall to pcall_err
- Rename `meth_pcall`.
- Make `pcall_err` raise an error if the function does not fail.
- Add `vim.pesc()` to treat a string as literal where a Lua pattern is
expected.
Diffstat (limited to 'test/functional/autocmd/autocmd_spec.lua')
-rw-r--r-- | test/functional/autocmd/autocmd_spec.lua | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/test/functional/autocmd/autocmd_spec.lua b/test/functional/autocmd/autocmd_spec.lua index 0a583b6d8d..805db9dd78 100644 --- a/test/functional/autocmd/autocmd_spec.lua +++ b/test/functional/autocmd/autocmd_spec.lua @@ -7,7 +7,7 @@ local eval = helpers.eval local feed = helpers.feed local clear = helpers.clear local meths = helpers.meths -local meth_pcall = helpers.meth_pcall +local pcall_err = helpers.pcall_err local funcs = helpers.funcs local expect = helpers.expect local command = helpers.command @@ -219,8 +219,8 @@ describe('autocmd', function() eq(7, eval('g:test')) -- API calls are blocked when aucmd_win is not in scope - eq({false, 'Vim(call):E5555: API call: Invalid window id'}, - meth_pcall(command, "call nvim_set_current_win(g:winid)")) + eq('Vim(call):E5555: API call: Invalid window id', + pcall_err(command, "call nvim_set_current_win(g:winid)")) -- second time aucmd_win is needed, a different code path is invoked -- to reuse the same window, so check again @@ -257,8 +257,8 @@ describe('autocmd', function() eq(0, eval('g:had_value')) eq(7, eval('g:test')) - eq({false, 'Vim(call):E5555: API call: Invalid window id'}, - meth_pcall(command, "call nvim_set_current_win(g:winid)")) + eq('Vim(call):E5555: API call: Invalid window id', + pcall_err(command, "call nvim_set_current_win(g:winid)")) end) it(':doautocmd does not warn "No matching autocommands" #10689', function() |