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

Function TestMappingUnexportedField

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

Source from the content-addressed store, hash-verified

107}
108
109func TestMappingUnexportedField(t *testing.T) {
110 var s struct {
111 A int `form:"a"`
112 b int `form:"b"`
113 }
114 err := mappingByPtr(&s, formSource{"a": {"9"}, "b": {"9"}}, "form")
115 require.NoError(t, err)
116
117 assert.Equal(t, 9, s.A)
118 assert.Equal(t, 0, s.b)
119}
120
121func TestMappingPrivateField(t *testing.T) {
122 var s struct {

Callers

nothing calls this directly

Calls 1

mappingByPtrFunction · 0.85

Tested by

no test coverage detected