Support IPv6 server addresses without ports

This commit is contained in:
Brandon McGinty (chatgpt)
2026-08-09 23:55:51 -04:00
committed by Brandon McGinty
parent 770635955a
commit d7dcaa8b21
2 changed files with 24 additions and 3 deletions
+14
View File
@@ -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{