github.com/blueinnovationsgroup/can-go@v0.0.0-20230518195432-d0567cda0028/pkg/dbc/signalvaluetype_test.go (about) 1 package dbc 2 3 import ( 4 "testing" 5 6 "gotest.tools/v3/assert" 7 ) 8 9 func TestSignalValueType_Validate(t *testing.T) { 10 for _, tt := range []SignalValueType{ 11 SignalValueTypeInt, 12 SignalValueTypeFloat32, 13 SignalValueTypeFloat64, 14 } { 15 assert.NilError(t, tt.Validate()) 16 } 17 } 18 19 func TestSignalValueType_Validate_Error(t *testing.T) { 20 assert.Error(t, SignalValueType(42).Validate(), "invalid signal value type: 42") 21 }