mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
test: server_spec: Tolerate missing protocol (#7478)
Travis disabled IPv6:
[ RUN ] serverstart(), serverstop() parses endpoints correctly: FAIL
...build/neovim/neovim/test/functional/eval/server_spec.lua:83: Expected objects to be the same.
Passed in:
(table) {
[1] = '127.0.0.1:12345' }
Expected:
(table) {
[1] = '127.0.0.1:12345'
*[2] = '::1:12345' }
Change all tests to ensure a server was actually started before
expecting it to be returned from serverlist().
This commit is contained in:
committed by
Justin M. Keyes
parent
54b79f19d7
commit
a39c8b7ce3
@@ -63,23 +63,33 @@ describe('serverstart(), serverstop()', function()
|
||||
eq({}, funcs.serverlist())
|
||||
|
||||
local s = funcs.serverstart('127.0.0.1:0') -- assign random port
|
||||
assert(string.match(s, '127.0.0.1:%d+'))
|
||||
eq(s, funcs.serverlist()[1])
|
||||
clear_serverlist()
|
||||
if #s > 0 then
|
||||
assert(string.match(s, '127.0.0.1:%d+'))
|
||||
eq(s, funcs.serverlist()[1])
|
||||
clear_serverlist()
|
||||
end
|
||||
|
||||
s = funcs.serverstart('127.0.0.1:') -- assign random port
|
||||
assert(string.match(s, '127.0.0.1:%d+'))
|
||||
eq(s, funcs.serverlist()[1])
|
||||
clear_serverlist()
|
||||
if #s > 0 then
|
||||
assert(string.match(s, '127.0.0.1:%d+'))
|
||||
eq(s, funcs.serverlist()[1])
|
||||
clear_serverlist()
|
||||
end
|
||||
|
||||
funcs.serverstart('127.0.0.1:12345')
|
||||
funcs.serverstart('127.0.0.1:12345') -- exists already; ignore
|
||||
funcs.serverstart('::1:12345')
|
||||
funcs.serverstart('::1:12345') -- exists already; ignore
|
||||
local expected = {
|
||||
'127.0.0.1:12345',
|
||||
'::1:12345',
|
||||
}
|
||||
local expected = {}
|
||||
local v4 = '127.0.0.1:12345'
|
||||
s = funcs.serverstart(v4)
|
||||
if #s > 0 then
|
||||
table.insert(expected, v4)
|
||||
funcs.serverstart(v4) -- exists already; ignore
|
||||
end
|
||||
|
||||
local v6 = '::1:12345'
|
||||
s = funcs.serverstart(v6)
|
||||
if #s > 0 then
|
||||
table.insert(expected, v6)
|
||||
funcs.serverstart(v6) -- exists already; ignore
|
||||
end
|
||||
eq(expected, funcs.serverlist())
|
||||
clear_serverlist()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user