diff --git a/request_test.go b/request_test.go index 79ec030..8ee4a5a 100644 --- a/request_test.go +++ b/request_test.go @@ -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) {