mirror of
https://github.com/fosrl/newt.git
synced 2026-02-07 21:46:39 +00:00
33 lines
621 B
Go
33 lines
621 B
Go
package telemetry
|
|
|
|
import "testing"
|
|
|
|
func TestAllowedConstants(t *testing.T) {
|
|
allowedReasons := map[string]struct{}{
|
|
ReasonServerRequest: {},
|
|
ReasonTimeout: {},
|
|
ReasonPeerClose: {},
|
|
ReasonNetworkChange: {},
|
|
ReasonAuthError: {},
|
|
ReasonHandshakeError: {},
|
|
ReasonConfigChange: {},
|
|
ReasonError: {},
|
|
}
|
|
for k := range allowedReasons {
|
|
if k == "" {
|
|
t.Fatalf("empty reason constant")
|
|
}
|
|
}
|
|
|
|
allowedProtocols := map[string]struct{}{
|
|
ProtocolTCP: {},
|
|
ProtocolUDP: {},
|
|
}
|
|
for k := range allowedProtocols {
|
|
if k == "" {
|
|
t.Fatalf("empty protocol constant")
|
|
}
|
|
}
|
|
}
|
|
|