MCPcopy
hub / github.com/gin-gonic/gin / TestMappingCollectionFormatInvalid

Function TestMappingCollectionFormatInvalid

binding/form_mapping_test.go:366–382  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

364}
365
366func 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
384func TestMappingMultipleDefaultWithCollectionFormat(t *testing.T) {
385 var s struct {

Callers

nothing calls this directly

Calls 2

mappingByPtrFunction · 0.85
ErrorMethod · 0.45

Tested by

no test coverage detected