aboutsummaryrefslogtreecommitdiff
path: root/test/functional/core/job_spec.lua
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2024-03-30 09:29:21 +0800
committerGitHub <noreply@github.com>2024-03-30 09:29:21 +0800
commit35239e977f53c25016b57729cada612aa53e11d4 (patch)
tree45e24edd39b7b80199d4a2b510add5c57f4148a8 /test/functional/core/job_spec.lua
parent19d63563e1cceabbf8603d0abb2e88fae5bd3626 (diff)
downloadrneovim-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/job_spec.lua')
-rw-r--r--test/functional/core/job_spec.lua9
1 files changed, 3 insertions, 6 deletions
diff --git a/test/functional/core/job_spec.lua b/test/functional/core/job_spec.lua
index 9e7f1faa47..b7e9af99ac 100644
--- a/test/functional/core/job_spec.lua
+++ b/test/functional/core/job_spec.lua
@@ -73,7 +73,7 @@ describe('jobs', function()
command("let j = jobstart('env', g:job_opts)")
end
end)
- ok(string.find(err, 'E475: Invalid argument: env') ~= nil)
+ matches('E475: Invalid argument: env', err)
end)
it('append environment #env', function()
@@ -227,7 +227,7 @@ describe('jobs', function()
command("let j = jobstart('pwd', g:job_opts)")
end
end)
- ok(string.find(err, 'E475: Invalid argument: expected valid directory$') ~= nil)
+ matches('E475: Invalid argument: expected valid directory$', err)
end)
it('error on non-executable `cwd`', function()
@@ -980,10 +980,7 @@ describe('jobs', function()
command('let g:job_opts.pty = v:true')
command('let g:job_opts.rpc = v:true')
local _, err = pcall(command, "let j = jobstart(['cat', '-'], g:job_opts)")
- ok(
- string.find(err, "E475: Invalid argument: job cannot have both 'pty' and 'rpc' options set")
- ~= nil
- )
+ matches("E475: Invalid argument: job cannot have both 'pty' and 'rpc' options set", err)
end)
it('does not crash when repeatedly failing to start shell', function()