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

Function TestBindJSON

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

Source from the content-addressed store, hash-verified

200}
201
202func TestBindJSON(t *testing.T) {
203 testBindOkay(t, strings.NewReader(userJSON), nil, MIMEApplicationJSON)
204 testBindOkay(t, strings.NewReader(userJSON), dummyQuery, MIMEApplicationJSON)
205 testBindArrayOkay(t, strings.NewReader(usersJSON), nil, MIMEApplicationJSON)
206 testBindArrayOkay(t, strings.NewReader(usersJSON), dummyQuery, MIMEApplicationJSON)
207 testBindError(t, strings.NewReader(invalidContent), MIMEApplicationJSON, &json.SyntaxError{})
208 testBindError(t, strings.NewReader(userJSONInvalidType), MIMEApplicationJSON, &json.UnmarshalTypeError{})
209}
210
211func TestBindXML(t *testing.T) {
212 testBindOkay(t, strings.NewReader(userXML), nil, MIMEApplicationXML)

Callers

nothing calls this directly

Calls 3

testBindOkayFunction · 0.85
testBindArrayOkayFunction · 0.85
testBindErrorFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…