(t *testing.T)
| 364 | } |
| 365 | |
| 366 | func TestMappingCollectionFormatInvalid(t *testing.T) { |
| 367 | var s struct { |
| 368 | SliceCsv []int `form:"slice_csv" collection_format:"xxx"` |
| 369 | } |
| 370 | err := mappingByPtr(&s, formSource{ |
| 371 | "slice_csv": {"1,2"}, |
| 372 | }, "form") |
| 373 | require.Error(t, err) |
| 374 | |
| 375 | var s2 struct { |
| 376 | ArrayCsv [2]int `form:"array_csv" collection_format:"xxx"` |
| 377 | } |
| 378 | err = mappingByPtr(&s2, formSource{ |
| 379 | "array_csv": {"1,2"}, |
| 380 | }, "form") |
| 381 | require.Error(t, err) |
| 382 | } |
| 383 | |
| 384 | func TestMappingMultipleDefaultWithCollectionFormat(t *testing.T) { |
| 385 | var s struct { |
nothing calls this directly
no test coverage detected