MCPcopy Index your code
hub / github.com/google/go-github / testFormValues

Function testFormValues

github/github_test.go:169–181  ·  view source on GitHub ↗

testFormValues checks that the request form values match the expected values. It expects exactly one value per key.

(t *testing.T, r *http.Request, want values)

Source from the content-addressed store, hash-verified

167// testFormValues checks that the request form values match the expected values.
168// It expects exactly one value per key.
169func testFormValues(t *testing.T, r *http.Request, want values) {
170 t.Helper()
171
172 wantValues := url.Values{}
173 for k, v := range want {
174 wantValues.Add(k, v)
175 }
176
177 assertNilError(t, r.ParseForm())
178 if got := r.Form; !cmp.Equal(got, wantValues) {
179 t.Errorf("Request query parameters: %v, want %v", got, wantValues)
180 }
181}
182
183// testFormValuesList checks that the request form values match the expected values.
184// It allows for multiple values per key.

Calls 3

AddMethod · 0.80
EqualMethod · 0.80
assertNilErrorFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…