diff --git a/go/lib/env/BUILD.bazel b/go/lib/env/BUILD.bazel index 025574b5ee..24fe5bc73f 100644 --- a/go/lib/env/BUILD.bazel +++ b/go/lib/env/BUILD.bazel @@ -1,4 +1,4 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_library") +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") go_library( name = "go_default_library", @@ -30,3 +30,11 @@ go_library( "@com_github_uber_jaeger_client_go//config:go_default_library", ], ) + +go_test( + name = "go_default_test", + srcs = ["features_test.go"], + data = glob(["testdata/**"]), + embed = [":go_default_library"], + deps = ["@com_github_stretchr_testify//assert:go_default_library"], +) diff --git a/go/lib/env/features_test.go b/go/lib/env/features_test.go new file mode 100644 index 0000000000..d2ac713c78 --- /dev/null +++ b/go/lib/env/features_test.go @@ -0,0 +1,29 @@ +// Copyright 2019 ETH Zurich, Anapaya Systems +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package env + +import ( + "reflect" + "testing" + + "github.com/stretchr/testify/assert" +) + +func TestAllFeatureFlagsShouldBeBoolean(t *testing.T) { + features := reflect.TypeOf(Features{}) + for i := 0; i < features.NumField(); i++ { + assert.Equal(t, reflect.Bool, features.Field(i).Type.Kind()) + } +}