test: Eliminate expect_err

Eliminate `expect_err` in favor of `pcall_err` + `eq` or `matches`.
This commit is contained in:
Justin M. Keyes
2019-09-06 17:17:37 -07:00
parent af946046b9
commit 7e1c959861
21 changed files with 214 additions and 216 deletions

View File

@@ -5,7 +5,7 @@ local clear, funcs, meths = helpers.clear, helpers.funcs, helpers.meths
local iswin = helpers.iswin
local ok = helpers.ok
local matches = helpers.matches
local expect_err = helpers.expect_err
local pcall_err = helpers.pcall_err
local function clear_serverlist()
for _, server in pairs(funcs.serverlist()) do
@@ -102,8 +102,8 @@ describe('server', function()
eq(expected, funcs.serverlist())
clear_serverlist()
expect_err('Failed to start server: invalid argument',
funcs.serverstart, '127.0.0.1:65536') -- invalid port
eq('Vim:Failed to start server: invalid argument',
pcall_err(funcs.serverstart, '127.0.0.1:65536')) -- invalid port
eq({}, funcs.serverlist())
end)