github.com/blueinnovationsgroup/can-go@v0.0.0-20230518195432-d0567cda0028/pkg/dbc/envvartype_test.go (about) 1 package dbc 2 3 import ( 4 "testing" 5 6 "gotest.tools/v3/assert" 7 ) 8 9 func TestEnvironmentVariableType_Validate(t *testing.T) { 10 for _, tt := range []EnvironmentVariableType{ 11 EnvironmentVariableTypeInteger, 12 EnvironmentVariableTypeFloat, 13 EnvironmentVariableTypeString, 14 } { 15 assert.NilError(t, tt.Validate()) 16 } 17 } 18 19 func TestEnvironmentVariableType_Validate_Error(t *testing.T) { 20 assert.Error(t, EnvironmentVariableType(42).Validate(), "invalid environment variable type: 42") 21 }