From 35239e977f53c25016b57729cada612aa53e11d4 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Sat, 30 Mar 2024 09:29:21 +0800 Subject: test: use matches(...) instead of ok(string.find(...)) (#28111) --- test/functional/ex_cmds/arg_spec.lua | 3 ++- test/functional/ex_cmds/edit_spec.lua | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) (limited to 'test/functional/ex_cmds') diff --git a/test/functional/ex_cmds/arg_spec.lua b/test/functional/ex_cmds/arg_spec.lua index 810b001ec0..45b2f50af1 100644 --- a/test/functional/ex_cmds/arg_spec.lua +++ b/test/functional/ex_cmds/arg_spec.lua @@ -1,6 +1,7 @@ local helpers = require('test.functional.helpers')(after_each) local eq, command, fn = helpers.eq, helpers.command, helpers.fn local ok = helpers.ok +local matches = helpers.matches local clear = helpers.clear describe(':argument', function() @@ -15,7 +16,7 @@ describe(':argument', function() helpers.feed([[]]) local bufname_before = fn.bufname('%') local bufnr_before = fn.bufnr('%') - helpers.ok(nil ~= string.find(bufname_before, '^term://')) -- sanity + matches('^term://', bufname_before) -- sanity command('argument 1') helpers.feed([[]]) diff --git a/test/functional/ex_cmds/edit_spec.lua b/test/functional/ex_cmds/edit_spec.lua index b927fa418a..9d4effd72e 100644 --- a/test/functional/ex_cmds/edit_spec.lua +++ b/test/functional/ex_cmds/edit_spec.lua @@ -1,6 +1,7 @@ local helpers = require('test.functional.helpers')(after_each) local eq, command, fn = helpers.eq, helpers.command, helpers.fn local ok = helpers.ok +local matches = helpers.matches local clear = helpers.clear local feed = helpers.feed @@ -14,7 +15,7 @@ describe(':edit', function() feed([[]]) local bufname_before = fn.bufname('%') local bufnr_before = fn.bufnr('%') - helpers.ok(nil ~= string.find(bufname_before, '^term://')) -- sanity + matches('^term://', bufname_before) -- sanity command('edit') -- cgit