feat(botfilter): add TestCompileConfigRejectsInvalidCIDR

This commit is contained in:
hoelee committed 2026-07-16 09:32:00 +08:00
1 parent 1183a20295
commit 69bb300958
1 file changed
+7
+7
View File
@@ -174,3 +174,10 @@ func TestTrustedProxyHeaderSeparatesClients(t *testing.T) {
}
}
func TestCompileConfigRejectsInvalidCIDR(t *testing.T) {
cfg := CreateConfig()
cfg.WhitelistCIDRs = []string{"not-a-cidr"}
if _, err := compileConfig(cfg); err == nil {
t.Fatal("compileConfig() error = nil, want invalid CIDR error")
}
}