MCPcopy Create free account
hub / github.com/prest/prest / TestExtractQueryParameters

Function TestExtractQueryParameters

controllers/script_test.go:167–175  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

165}
166
167func TestExtractQueryParameters(t *testing.T) {
168 req := httptest.NewRequest(http.MethodGet, "/?foo=bar&tag=a&tag=b", nil)
169
170 data := map[string]interface{}{}
171 extractQueryParameters(req, data)
172
173 require.Equal(t, "bar", data["foo"])
174 require.Equal(t, []string{"a", "b"}, data["tag"])
175}

Callers

nothing calls this directly

Calls 1

extractQueryParametersFunction · 0.85

Tested by

no test coverage detected