Support IPv6 server addresses without ports
This commit is contained in:
committed by
Brandon McGinty
parent
770635955a
commit
d7dcaa8b21
@@ -69,6 +69,20 @@ func TestNotificationExpansionIsSinglePassAndNotifyDoesNotBlock(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestServerAddressDefaultsPortWithoutBreakingIPv6(t *testing.T) {
|
||||
for input, want := range map[string]string{
|
||||
"server": "server:64738",
|
||||
"server:64739": "server:64739",
|
||||
"::1": "[::1]:64738",
|
||||
"[2001:db8::1]": "[2001:db8::1]:64738",
|
||||
"[2001:db8::1]:9": "[2001:db8::1]:9",
|
||||
} {
|
||||
if got := serverAddress(input); got != want {
|
||||
t.Errorf("serverAddress(%q) = %q, want %q", input, got, want)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func TestPublicServerMessageDoesNotPanic(t *testing.T) {
|
||||
channel := &gumble.Channel{ID: 1, Name: "Current"}
|
||||
b := &Barnard{
|
||||
|
||||
Reference in New Issue
Block a user