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

Function TestHEAD

ginS/gins_test.go:99–109  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

97}
98
99func TestHEAD(t *testing.T) {
100 HEAD("/head", func(c *gin.Context) {
101 c.String(http.StatusOK, "head")
102 })
103
104 req := httptest.NewRequest(http.MethodHead, "/head", nil)
105 w := httptest.NewRecorder()
106 engine().ServeHTTP(w, req)
107
108 assert.Equal(t, http.StatusOK, w.Code)
109}
110
111func TestAny(t *testing.T) {
112 Any("/any", func(c *gin.Context) {

Callers

nothing calls this directly

Calls 3

HEADFunction · 0.85
StringMethod · 0.65
ServeHTTPMethod · 0.45

Tested by

no test coverage detected