MCPcopy Index your code
hub / github.com/labstack/echo / TestEchoHead

Function TestEchoHead

echo_test.go:809–824  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

807}
808
809func TestEchoHead(t *testing.T) {
810 e := New()
811
812 ri := e.HEAD("/", func(c *Context) error {
813 return c.String(http.StatusTeapot, "OK")
814 })
815
816 assert.Equal(t, http.MethodHead, ri.Method)
817 assert.Equal(t, "/", ri.Path)
818 assert.Equal(t, http.MethodHead+":/", ri.Name)
819 assert.Nil(t, ri.Parameters)
820
821 status, body := request(http.MethodHead, "/", e)
822 assert.Equal(t, http.StatusTeapot, status)
823 assert.Equal(t, "OK", body)
824}
825
826func TestEchoOptions(t *testing.T) {
827 e := New()

Callers

nothing calls this directly

Calls 4

NewFunction · 0.85
requestFunction · 0.85
HEADMethod · 0.45
StringMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…