test: use matches(...) instead of ok(string.find(...)) (#28111)

This commit is contained in:
zeertzjq
2024-03-30 09:29:21 +08:00
committed by GitHub
parent 19d63563e1
commit 35239e977f
8 changed files with 20 additions and 24 deletions

View File

@@ -100,14 +100,14 @@ describe('server', function()
local s = fn.serverstart('127.0.0.1:0') -- assign random port
if #s > 0 then
assert(string.match(s, '127.0.0.1:%d+'))
matches('127.0.0.1:%d+', s)
eq(s, fn.serverlist()[1])
clear_serverlist()
end
s = fn.serverstart('127.0.0.1:') -- assign random port
if #s > 0 then
assert(string.match(s, '127.0.0.1:%d+'))
matches('127.0.0.1:%d+', s)
eq(s, fn.serverlist()[1])
clear_serverlist()
end