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

Function TestMappingCustomArrayOfArrayForm

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

Source from the content-addressed store, hash-verified

726}
727
728func TestMappingCustomArrayOfArrayForm(t *testing.T) {
729 id1, _ := convertTo(`664a062ac74a8ad104e0e80e`)
730 id2, _ := convertTo(`664a062ac74a8ad104e0e80f`)
731
732 var s struct {
733 FileData []objectID `form:"ids" collection_format:"csv"`
734 }
735 err := mappingByPtr(&s, formSource{"ids": {`664a062ac74a8ad104e0e80e,664a062ac74a8ad104e0e80f`}}, "form")
736 require.NoError(t, err)
737 assert.Equal(t, []objectID{id1, id2}, s.FileData)
738}
739
740// ==== TextUnmarshaler tests START ====
741

Callers

nothing calls this directly

Calls 2

convertToFunction · 0.85
mappingByPtrFunction · 0.85

Tested by

no test coverage detected