diff --git a/validator/any_test.go b/validator/any_test.go index d612047..4ec04f1 100644 --- a/validator/any_test.go +++ b/validator/any_test.go @@ -2,11 +2,24 @@ package validator_test import ( "fmt" + "reflect" "testing" "github.com/xdrm-io/aicra/validator" ) +func TestAny_ReflectType(t *testing.T) { + t.Parallel() + + var ( + dt = validator.AnyType{} + expected = reflect.TypeOf(interface{}(nil)) + ) + if dt.GoType() != expected { + t.Fatalf("invalid GoType() %v ; expected %v", dt.GoType(), expected) + } +} + func TestAny_AvailableTypes(t *testing.T) { t.Parallel() diff --git a/validator/bool_test.go b/validator/bool_test.go index 8600d34..f34819d 100644 --- a/validator/bool_test.go +++ b/validator/bool_test.go @@ -2,11 +2,24 @@ package validator_test import ( "fmt" + "reflect" "testing" "github.com/xdrm-io/aicra/validator" ) +func TestBool_ReflectType(t *testing.T) { + t.Parallel() + + var ( + dt = validator.BoolType{} + expected = reflect.TypeOf(true) + ) + if dt.GoType() != expected { + t.Fatalf("invalid GoType() %v ; expected %v", dt.GoType(), expected) + } +} + func TestBool_AvailableTypes(t *testing.T) { t.Parallel() diff --git a/validator/float_test.go b/validator/float_test.go index b965441..1a77949 100644 --- a/validator/float_test.go +++ b/validator/float_test.go @@ -3,11 +3,24 @@ package validator_test import ( "fmt" "math" + "reflect" "testing" "github.com/xdrm-io/aicra/validator" ) +func TestFloat64_ReflectType(t *testing.T) { + t.Parallel() + + var ( + dt = validator.FloatType{} + expected = reflect.TypeOf(float64(0.0)) + ) + if dt.GoType() != expected { + t.Fatalf("invalid GoType() %v ; expected %v", dt.GoType(), expected) + } +} + func TestFloat64_AvailableTypes(t *testing.T) { t.Parallel() diff --git a/validator/int_test.go b/validator/int_test.go index 14dc515..b99afea 100644 --- a/validator/int_test.go +++ b/validator/int_test.go @@ -3,11 +3,24 @@ package validator_test import ( "fmt" "math" + "reflect" "testing" "github.com/xdrm-io/aicra/validator" ) +func TestInt_ReflectType(t *testing.T) { + t.Parallel() + + var ( + dt = validator.IntType{} + expected = reflect.TypeOf(int(0)) + ) + if dt.GoType() != expected { + t.Fatalf("invalid GoType() %v ; expected %v", dt.GoType(), expected) + } +} + func TestInt_AvailableTypes(t *testing.T) { t.Parallel() diff --git a/validator/string_test.go b/validator/string_test.go index 0a038ef..deb8ec1 100644 --- a/validator/string_test.go +++ b/validator/string_test.go @@ -2,11 +2,24 @@ package validator_test import ( "fmt" + "reflect" "testing" "github.com/xdrm-io/aicra/validator" ) +func TestString_ReflectType(t *testing.T) { + t.Parallel() + + var ( + dt = validator.StringType{} + expected = reflect.TypeOf(string("abc")) + ) + if dt.GoType() != expected { + t.Fatalf("invalid GoType() %v ; expected %v", dt.GoType(), expected) + } +} + func TestString_AvailableTypes(t *testing.T) { t.Parallel() diff --git a/validator/uint_test.go b/validator/uint_test.go index 4fc9be9..d754124 100644 --- a/validator/uint_test.go +++ b/validator/uint_test.go @@ -3,11 +3,24 @@ package validator_test import ( "fmt" "math" + "reflect" "testing" "github.com/xdrm-io/aicra/validator" ) +func TestUint_ReflectType(t *testing.T) { + t.Parallel() + + var ( + dt = validator.UintType{} + expected = reflect.TypeOf(uint(0)) + ) + if dt.GoType() != expected { + t.Fatalf("invalid GoType() %v ; expected %v", dt.GoType(), expected) + } +} + func TestUint_AvailableTypes(t *testing.T) { t.Parallel()