MCPcopy
hub / github.com/gin-gonic/gin / TestRenderMsgPackError

Function TestRenderMsgPackError

render/render_msgpack_test.go:71–80  ·  render/render_msgpack_test.go::TestRenderMsgPackError
(t *testing.T)

Source from the content-addressed store, hash-verified

69}
70
71func TestRenderMsgPackError(t *testing.T) {
72 w := httptest.NewRecorder()
73 data := map[string]any{
74 "foo": "bar",
75 }
76
77 err := (MsgPack{data}).Render(&failWriter{w})
78 require.Error(t, err)
79 assert.Contains(t, err.Error(), "write error")
80}

Callers

nothing calls this directly

Calls 2

RenderMethod · 0.65
ErrorMethod · 0.45

Tested by

no test coverage detected