package proxy import "testing" func TestIsCertDownloadHost(t *testing.T) { tests := []struct { host string want bool }{ {"mitmux.cert", true}, {"mitmux.cert:80", true}, {"MITMUX.CERT", true}, {"Mitmux.Cert:8080", true}, {"example.com", false}, {"notmitmux.cert", false}, {"mitmux.cert.evil.com", false}, {"", false}, } for _, tt := range tests { if got := isCertDownloadHost(tt.host); got != tt.want { t.Errorf("isCertDownloadHost(%q) = %v, want %v", tt.host, got, tt.want) } } }