forked from Mirrors/jsonapi
check for ptr error type in tests
This commit is contained in:
parent
9bc94d8c70
commit
72f7bad5b3
|
@ -136,6 +136,9 @@ func TestUnmarshalToStructWithPointerAttr_BadType_bool(t *testing.T) {
|
|||
if err.Error() != expectedErrorMessage {
|
||||
t.Fatalf("Unexpected error message: %s", err.Error())
|
||||
}
|
||||
if _, ok := err.(ErrUnsupportedPtrType); !ok {
|
||||
t.Fatalf("Unexpected error type: %s", reflect.TypeOf(err))
|
||||
}
|
||||
}
|
||||
|
||||
func TestUnmarshalToStructWithPointerAttr_BadType_MapPtr(t *testing.T) {
|
||||
|
@ -153,6 +156,9 @@ func TestUnmarshalToStructWithPointerAttr_BadType_MapPtr(t *testing.T) {
|
|||
if err.Error() != expectedErrorMessage {
|
||||
t.Fatalf("Unexpected error message: %s", err.Error())
|
||||
}
|
||||
if _, ok := err.(ErrUnsupportedPtrType); !ok {
|
||||
t.Fatalf("Unexpected error type: %s", reflect.TypeOf(err))
|
||||
}
|
||||
}
|
||||
|
||||
func TestUnmarshalToStructWithPointerAttr_BadType_Struct(t *testing.T) {
|
||||
|
@ -171,6 +177,9 @@ func TestUnmarshalToStructWithPointerAttr_BadType_Struct(t *testing.T) {
|
|||
if err.Error() != expectedErrorMessage {
|
||||
t.Fatalf("Unexpected error message: %s", err.Error())
|
||||
}
|
||||
if _, ok := err.(ErrUnsupportedPtrType); !ok {
|
||||
t.Fatalf("Unexpected error type: %s", reflect.TypeOf(err))
|
||||
}
|
||||
}
|
||||
|
||||
func TestUnmarshalToStructWithPointerAttr_BadType_IntSlice(t *testing.T) {
|
||||
|
@ -189,6 +198,9 @@ func TestUnmarshalToStructWithPointerAttr_BadType_IntSlice(t *testing.T) {
|
|||
if err.Error() != expectedErrorMessage {
|
||||
t.Fatalf("Unexpected error message: %s", err.Error())
|
||||
}
|
||||
if _, ok := err.(ErrUnsupportedPtrType); !ok {
|
||||
t.Fatalf("Unexpected error type: %s", reflect.TypeOf(err))
|
||||
}
|
||||
}
|
||||
|
||||
func TestStringPointerField(t *testing.T) {
|
||||
|
|
Loading…
Reference in New Issue