(t *testing.T)
| 335 | } |
| 336 | |
| 337 | func Test_parseToStruct_MismatchedData(t *testing.T) { |
| 338 | t.Parallel() |
| 339 | |
| 340 | type User struct { |
| 341 | Name string `query:"name"` |
| 342 | Age int `query:"age"` |
| 343 | } |
| 344 | |
| 345 | data := map[string][]string{ |
| 346 | "name": {"John"}, |
| 347 | "age": {"invalidAge"}, |
| 348 | } |
| 349 | |
| 350 | err := parseToStruct("query", &User{}, data) |
| 351 | require.Error(t, err) |
| 352 | require.EqualError(t, err, "schema: error converting value for \"age\"") |
| 353 | } |
| 354 | |
| 355 | func Test_formatBindData_ErrorCases(t *testing.T) { |
| 356 | t.Parallel() |
nothing calls this directly
no test coverage detected