MCPcopy
hub / github.com/labstack/echo / TestBindUnmarshalParamAnonymousFieldPtr

Function TestBindUnmarshalParamAnonymousFieldPtr

bind_test.go:372–384  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

370}
371
372func TestBindUnmarshalParamAnonymousFieldPtr(t *testing.T) {
373 e := New()
374 req := httptest.NewRequest(http.MethodGet, "/?baz=1", nil)
375 rec := httptest.NewRecorder()
376 c := e.NewContext(req, rec)
377 result := struct {
378 *Bar
379 }{&Bar{}}
380 err := c.Bind(&result)
381 if assert.NoError(t, err) {
382 assert.Equal(t, 1, result.Baz)
383 }
384}
385
386func TestBindUnmarshalParamAnonymousFieldPtrNil(t *testing.T) {
387 e := New()

Callers

nothing calls this directly

Calls 3

BindMethod · 0.95
NewFunction · 0.85
NewContextMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…