MCPcopy Index your code
hub / github.com/apache/devlake / TestDecodeMapStructUrlVales

Function TestDecodeMapStructUrlVales

backend/helpers/utils/mapstructure_test.go:143–157  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

141}
142
143func TestDecodeMapStructUrlVales(t *testing.T) {
144 query := &url.Values{}
145 query.Set("page", "1")
146 query.Set("pageSize", "100")
147
148 var pagination struct {
149 Page int `mapstructure:"page"`
150 PageSize int `mapstructure:"pageSize"`
151 }
152
153 err := DecodeMapStruct(query, &pagination, true)
154 assert.Nil(t, err)
155 assert.Equal(t, 1, pagination.Page)
156 assert.Equal(t, 100, pagination.PageSize)
157}

Callers

nothing calls this directly

Calls 1

DecodeMapStructFunction · 0.70

Tested by

no test coverage detected