aboutsummaryrefslogtreecommitdiff
path: root/test/functional/eval/wait_spec.lua
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2019-09-06 18:16:57 -0700
committerGitHub <noreply@github.com>2019-09-06 18:16:57 -0700
commit158b78062e9daa65203b4591dae733dd6c11ad2c (patch)
treee6988da22f16062b57d50daeda084bcc489a6a1d /test/functional/eval/wait_spec.lua
parent638f2b6dee7439de303bea12dec80240617e8034 (diff)
parent7e1c9598617a140e40a0a22676c0631294617246 (diff)
downloadrneovim-158b78062e9daa65203b4591dae733dd6c11ad2c.tar.gz
rneovim-158b78062e9daa65203b4591dae733dd6c11ad2c.tar.bz2
rneovim-158b78062e9daa65203b4591dae733dd6c11ad2c.zip
Merge #10932 'test: Eliminate expect_err'
Diffstat (limited to 'test/functional/eval/wait_spec.lua')
-rw-r--r--test/functional/eval/wait_spec.lua15
1 files changed, 6 insertions, 9 deletions
diff --git a/test/functional/eval/wait_spec.lua b/test/functional/eval/wait_spec.lua
index 5bb27131f5..341f2dc435 100644
--- a/test/functional/eval/wait_spec.lua
+++ b/test/functional/eval/wait_spec.lua
@@ -4,12 +4,12 @@ local clear = helpers.clear
local command = helpers.command
local eval = helpers.eval
local eq = helpers.eq
-local expect_err = helpers.expect_err
local feed = helpers.feed
local feed_command = helpers.feed_command
local next_msg = helpers.next_msg
local nvim = helpers.nvim
local source = helpers.source
+local pcall_err = helpers.pcall_err
before_each(function()
clear()
@@ -66,13 +66,10 @@ describe('wait()', function()
eq(5, nvim('get_var', 'counter'))
end)
- it('errors out on invalid timeout value', function()
- expect_err('Invalid value for argument', call, 'wait', '', 1)
- end)
-
- it('errors out on invalid interval', function()
- expect_err('Invalid value for argument', call, 'wait', 0, 1, -1)
- expect_err('Invalid value for argument', call, 'wait', 0, 1, 0)
- expect_err('Invalid value for argument', call, 'wait', 0, 1, '')
+ it('validates args', function()
+ eq('Vim:E475: Invalid value for argument 1', pcall_err(call, 'wait', '', 1))
+ eq('Vim:E475: Invalid value for argument 3', pcall_err(call, 'wait', 0, 1, -1))
+ eq('Vim:E475: Invalid value for argument 3', pcall_err(call, 'wait', 0, 1, 0))
+ eq('Vim:E475: Invalid value for argument 3', pcall_err(call, 'wait', 0, 1, ''))
end)
end)