diff options
author | Justin M. Keyes <justinkz@gmail.com> | 2019-09-06 17:17:37 -0700 |
---|---|---|
committer | Justin M. Keyes <justinkz@gmail.com> | 2019-09-06 17:19:07 -0700 |
commit | 7e1c9598617a140e40a0a22676c0631294617246 (patch) | |
tree | e6988da22f16062b57d50daeda084bcc489a6a1d /test/functional/api/window_spec.lua | |
parent | af946046b922dc5d5285a70a23d11916d8389a5d (diff) | |
download | rneovim-7e1c9598617a140e40a0a22676c0631294617246.tar.gz rneovim-7e1c9598617a140e40a0a22676c0631294617246.tar.bz2 rneovim-7e1c9598617a140e40a0a22676c0631294617246.zip |
test: Eliminate expect_err
Eliminate `expect_err` in favor of `pcall_err` + `eq` or `matches`.
Diffstat (limited to 'test/functional/api/window_spec.lua')
-rw-r--r-- | test/functional/api/window_spec.lua | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/test/functional/api/window_spec.lua b/test/functional/api/window_spec.lua index 3323d3866d..17e0d3235c 100644 --- a/test/functional/api/window_spec.lua +++ b/test/functional/api/window_spec.lua @@ -10,7 +10,6 @@ local request = helpers.request local NIL = helpers.NIL local meths = helpers.meths local command = helpers.command -local expect_err = helpers.expect_err local pcall_err = helpers.pcall_err -- check if str is visible at the beginning of some line @@ -56,8 +55,8 @@ describe('API/win', function() end) it('validates args', function() - expect_err('Invalid buffer id$', window, 'set_buf', nvim('get_current_win'), 23) - expect_err('Invalid window id$', window, 'set_buf', 23, nvim('get_current_buf')) + eq('Invalid buffer id', pcall_err(window, 'set_buf', nvim('get_current_win'), 23)) + eq('Invalid window id', pcall_err(window, 'set_buf', 23, nvim('get_current_buf'))) end) end) @@ -340,7 +339,8 @@ describe('API/win', function() eq(3, #meths.list_wins()) eq(':', funcs.getcmdwintype()) -- Vim: not allowed to close other windows from cmdline-window. - expect_err('E11: Invalid in command%-line window; <CR> executes, CTRL%-C quits$', meths.win_close, oldwin, true) + eq('E11: Invalid in command-line window; <CR> executes, CTRL-C quits', + pcall_err(meths.win_close, oldwin, true)) -- Close cmdline-window. meths.win_close(0,true) eq(2, #meths.list_wins()) |