prysm-pulse/shared/featureconfig/flags_test.go

20 lines
457 B
Go
Raw Normal View History

package featureconfig
import (
"reflect"
2019-10-29 17:28:41 +00:00
"strings"
"testing"
)
func TestDeprecatedFlags(t *testing.T) {
for _, f := range deprecatedFlags {
fv := reflect.ValueOf(f)
if !fv.FieldByName("Hidden").Bool() {
t.Errorf("%s must be hidden when deprecated.", f.GetName())
}
2019-10-29 17:28:41 +00:00
if !strings.Contains(fv.FieldByName("Usage").String(), "DEPRECATED. DO NOT USE.") {
t.Errorf("Usage for %s must contain \"DEPRECATED. DO NOT USE.\"", f.GetName())
}
}
}