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

Function TestMappingCustomArrayOfArrayUri

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

Source from the content-addressed store, hash-verified

714}
715
716func TestMappingCustomArrayOfArrayUri(t *testing.T) {
717 id1, _ := convertTo(`664a062ac74a8ad104e0e80e`)
718 id2, _ := convertTo(`664a062ac74a8ad104e0e80f`)
719
720 var s struct {
721 FileData []objectID `uri:"ids" collection_format:"csv"`
722 }
723 err := mappingByPtr(&s, formSource{"ids": {`664a062ac74a8ad104e0e80e,664a062ac74a8ad104e0e80f`}}, "uri")
724 require.NoError(t, err)
725 assert.Equal(t, []objectID{id1, id2}, s.FileData)
726}
727
728func TestMappingCustomArrayOfArrayForm(t *testing.T) {
729 id1, _ := convertTo(`664a062ac74a8ad104e0e80e`)

Callers

nothing calls this directly

Calls 2

convertToFunction · 0.85
mappingByPtrFunction · 0.85

Tested by

no test coverage detected