@@ -136,6 +136,9 @@ func TestUnmarshalToStructWithPointerAttr_BadType_bool(t *testing.T) {
136136 if err .Error () != expectedErrorMessage {
137137 t .Fatalf ("Unexpected error message: %s" , err .Error ())
138138 }
139+ if _ , ok := err .(ErrUnsupportedPtrType ); ! ok {
140+ t .Fatalf ("Unexpected error type: %s" , reflect .TypeOf (err ))
141+ }
139142}
140143
141144func TestUnmarshalToStructWithPointerAttr_BadType_MapPtr (t * testing.T ) {
@@ -153,6 +156,9 @@ func TestUnmarshalToStructWithPointerAttr_BadType_MapPtr(t *testing.T) {
153156 if err .Error () != expectedErrorMessage {
154157 t .Fatalf ("Unexpected error message: %s" , err .Error ())
155158 }
159+ if _ , ok := err .(ErrUnsupportedPtrType ); ! ok {
160+ t .Fatalf ("Unexpected error type: %s" , reflect .TypeOf (err ))
161+ }
156162}
157163
158164func TestUnmarshalToStructWithPointerAttr_BadType_Struct (t * testing.T ) {
@@ -171,6 +177,9 @@ func TestUnmarshalToStructWithPointerAttr_BadType_Struct(t *testing.T) {
171177 if err .Error () != expectedErrorMessage {
172178 t .Fatalf ("Unexpected error message: %s" , err .Error ())
173179 }
180+ if _ , ok := err .(ErrUnsupportedPtrType ); ! ok {
181+ t .Fatalf ("Unexpected error type: %s" , reflect .TypeOf (err ))
182+ }
174183}
175184
176185func TestUnmarshalToStructWithPointerAttr_BadType_IntSlice (t * testing.T ) {
@@ -189,6 +198,9 @@ func TestUnmarshalToStructWithPointerAttr_BadType_IntSlice(t *testing.T) {
189198 if err .Error () != expectedErrorMessage {
190199 t .Fatalf ("Unexpected error message: %s" , err .Error ())
191200 }
201+ if _ , ok := err .(ErrUnsupportedPtrType ); ! ok {
202+ t .Fatalf ("Unexpected error type: %s" , reflect .TypeOf (err ))
203+ }
192204}
193205
194206func TestStringPointerField (t * testing.T ) {
0 commit comments