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

Function TestRenderSecureJSONFail

render/render_test.go:102–109  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

100}
101
102func TestRenderSecureJSONFail(t *testing.T) {
103 w := httptest.NewRecorder()
104 data := make(chan int)
105
106 // json: unsupported type: chan int
107 err := (SecureJSON{"while(1);", data}).Render(w)
108 require.Error(t, err)
109}
110
111func TestRenderJsonpJSON(t *testing.T) {
112 w1 := httptest.NewRecorder()

Callers

nothing calls this directly

Calls 2

RenderMethod · 0.65
ErrorMethod · 0.45

Tested by

no test coverage detected