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

Function TestContextHTML

context_test.go:195–206  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

193}
194
195func TestContextHTML(t *testing.T) {
196 rec := httptest.NewRecorder()
197 req := httptest.NewRequest(http.MethodGet, "/", nil)
198 c := NewContext(req, rec)
199
200 err := c.HTML(http.StatusOK, "Hi, Jon Snow")
201 if assert.NoError(t, err) {
202 assert.Equal(t, http.StatusOK, rec.Code)
203 assert.Equal(t, MIMETextHTMLCharsetUTF8, rec.Header().Get(HeaderContentType))
204 assert.Equal(t, "Hi, Jon Snow", rec.Body.String())
205 }
206}
207
208func TestContextHTMLBlob(t *testing.T) {
209 rec := httptest.NewRecorder()

Callers

nothing calls this directly

Calls 5

HTMLMethod · 0.95
NewContextFunction · 0.85
GetMethod · 0.45
HeaderMethod · 0.45
StringMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…