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

Function TestBindUnmarshalParamPtr

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

Source from the content-addressed store, hash-verified

356}
357
358func TestBindUnmarshalParamPtr(t *testing.T) {
359 e := New()
360 req := httptest.NewRequest(http.MethodGet, "/?ts=2016-12-06T19:09:05Z", nil)
361 rec := httptest.NewRecorder()
362 c := e.NewContext(req, rec)
363 result := struct {
364 Tptr *Timestamp `query:"ts"`
365 }{}
366 err := c.Bind(&result)
367 if assert.NoError(t, err) {
368 assert.Equal(t, Timestamp(time.Date(2016, 12, 6, 19, 9, 5, 0, time.UTC)), *result.Tptr)
369 }
370}
371
372func TestBindUnmarshalParamAnonymousFieldPtr(t *testing.T) {
373 e := New()

Callers

nothing calls this directly

Calls 4

BindMethod · 0.95
NewFunction · 0.85
TimestampTypeAlias · 0.85
NewContextMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…