From 7e1c9598617a140e40a0a22676c0631294617246 Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Fri, 6 Sep 2019 17:17:37 -0700 Subject: test: Eliminate expect_err Eliminate `expect_err` in favor of `pcall_err` + `eq` or `matches`. --- test/functional/eval/match_functions_spec.lua | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'test/functional/eval/match_functions_spec.lua') diff --git a/test/functional/eval/match_functions_spec.lua b/test/functional/eval/match_functions_spec.lua index 0ec465a34c..f399ef47d3 100644 --- a/test/functional/eval/match_functions_spec.lua +++ b/test/functional/eval/match_functions_spec.lua @@ -6,7 +6,7 @@ local clear = helpers.clear local funcs = helpers.funcs local command = helpers.command local exc_exec = helpers.exc_exec -local expect_err = helpers.expect_err +local pcall_err = helpers.pcall_err before_each(clear) @@ -41,11 +41,11 @@ describe('setmatches()', function() end) it('fails with -1 if highlight group is not defined', function() - expect_err('E28: No such highlight group name: 1', funcs.setmatches, - {{group=1, pattern=2, id=3, priority=4}}) + eq('Vim:E28: No such highlight group name: 1', + pcall_err(funcs.setmatches, {{group=1, pattern=2, id=3, priority=4}})) eq({}, funcs.getmatches()) - expect_err('E28: No such highlight group name: 1', funcs.setmatches, - {{group=1, pos1={2}, pos2={6}, id=3, priority=4, conceal=5}}) + eq('Vim:E28: No such highlight group name: 1', + pcall_err(funcs.setmatches, {{group=1, pos1={2}, pos2={6}, id=3, priority=4, conceal=5}})) eq({}, funcs.getmatches()) end) end) -- cgit