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/api/buffer_spec.lua | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'test/functional/api/buffer_spec.lua') diff --git a/test/functional/api/buffer_spec.lua b/test/functional/api/buffer_spec.lua index 1322daa64d..da7515f012 100644 --- a/test/functional/api/buffer_spec.lua +++ b/test/functional/api/buffer_spec.lua @@ -13,7 +13,6 @@ local NIL = helpers.NIL local command = helpers.command local bufmeths = helpers.bufmeths local feed = helpers.feed -local expect_err = helpers.expect_err local pcall_err = helpers.pcall_err describe('api/buf', function() @@ -191,14 +190,14 @@ describe('api/buf', function() it('fails correctly when input is not valid', function() eq(1, curbufmeths.get_number()) - expect_err([[String cannot contain newlines]], - bufmeths.set_lines, 1, 1, 2, false, {'b\na'}) + eq([[String cannot contain newlines]], + pcall_err(bufmeths.set_lines, 1, 1, 2, false, {'b\na'})) end) it("fails if 'nomodifiable'", function() command('set nomodifiable') - expect_err([[Buffer is not 'modifiable']], - bufmeths.set_lines, 1, 1, 2, false, {'a','b'}) + eq([[Buffer is not 'modifiable']], + pcall_err(bufmeths.set_lines, 1, 1, 2, false, {'a','b'})) end) it('has correct line_count when inserting and deleting', function() -- cgit