diff options
author | zeertzjq <zeertzjq@outlook.com> | 2024-03-30 09:29:21 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-03-30 09:29:21 +0800 |
commit | 35239e977f53c25016b57729cada612aa53e11d4 (patch) | |
tree | 45e24edd39b7b80199d4a2b510add5c57f4148a8 /test/functional/core/channels_spec.lua | |
parent | 19d63563e1cceabbf8603d0abb2e88fae5bd3626 (diff) | |
download | rneovim-35239e977f53c25016b57729cada612aa53e11d4.tar.gz rneovim-35239e977f53c25016b57729cada612aa53e11d4.tar.bz2 rneovim-35239e977f53c25016b57729cada612aa53e11d4.zip |
test: use matches(...) instead of ok(string.find(...)) (#28111)
Diffstat (limited to 'test/functional/core/channels_spec.lua')
-rw-r--r-- | test/functional/core/channels_spec.lua | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/test/functional/core/channels_spec.lua b/test/functional/core/channels_spec.lua index 56a2f5a571..0ab885e02f 100644 --- a/test/functional/core/channels_spec.lua +++ b/test/functional/core/channels_spec.lua @@ -2,6 +2,7 @@ local helpers = require('test.functional.helpers')(after_each) local clear, eq, eval, next_msg, ok, source = helpers.clear, helpers.eq, helpers.eval, helpers.next_msg, helpers.ok, helpers.source local command, fn, api = helpers.command, helpers.fn, helpers.api +local matches = helpers.matches local sleep = vim.uv.sleep local spawn, nvim_argv = helpers.spawn, helpers.nvim_argv local get_session, set_session = helpers.get_session, helpers.set_session @@ -277,7 +278,7 @@ describe('channels', function() local _, err = pcall(command, "call rpcrequest(id, 'nvim_command', 'call chanclose(v:stderr, \"stdin\")')") - ok(string.find(err, 'E906: invalid stream for channel') ~= nil) + matches('E906: invalid stream for channel', err) eq(1, eval("rpcrequest(id, 'nvim_eval', 'chanclose(v:stderr, \"stderr\")')")) eq({ 'notification', 'stderr', { 3, { '' } } }, next_msg()) |