add tests for invalid addr to net servers

This commit is contained in:
Joel Wetzell
2026-02-09 21:23:09 -06:00
parent e22a941e4a
commit 961316d28b
3 changed files with 25 additions and 0 deletions

View File

@@ -88,6 +88,15 @@ func TestBadTCPServer(t *testing.T) {
},
errorString: "net.tcp.server ip must be a string",
},
{
name: "invalid addr",
params: map[string]any{
"ip": "127.0.0.",
"port": 8000.0,
"framing": "LF",
},
errorString: "lookup 127.0.0.: no such host",
},
}
for _, test := range tests {

View File

@@ -71,6 +71,14 @@ func TestBadUDPMulticast(t *testing.T) {
},
errorString: "net.udp.multicast ip must be a string",
},
{
name: "invalid addr",
params: map[string]any{
"ip": "127.0.0.",
"port": 8000.0,
},
errorString: "lookup 127.0.0.: no such host",
},
}
for _, test := range tests {

View File

@@ -68,6 +68,14 @@ func TestBadUDPServer(t *testing.T) {
},
errorString: "net.udp.server bufferSize must be a number",
},
{
name: "invalid addr",
params: map[string]any{
"ip": "127.0.0.",
"port": 8000.0,
},
errorString: "lookup 127.0.0.: no such host",
},
}
for _, test := range tests {