From 69bb30095801b541648eb7756ff62b4cc63f8ebf Mon Sep 17 00:00:00 2001 From: hoelee Date: Thu, 16 Jul 2026 09:32:00 +0800 Subject: [PATCH] feat(botfilter): add TestCompileConfigRejectsInvalidCIDR --- botfilter_test.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/botfilter_test.go b/botfilter_test.go index f67e2797..1e885bc6 100644 --- a/botfilter_test.go +++ b/botfilter_test.go @@ -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") + } +}