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

Function TestPATCH

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

Source from the content-addressed store, hash-verified

71}
72
73func TestPATCH(t *testing.T) {
74 PATCH("/patch", func(c *gin.Context) {
75 c.String(http.StatusOK, "patched")
76 })
77
78 req := httptest.NewRequest(http.MethodPatch, "/patch", nil)
79 w := httptest.NewRecorder()
80 engine().ServeHTTP(w, req)
81
82 assert.Equal(t, http.StatusOK, w.Code)
83 assert.Equal(t, "patched", w.Body.String())
84}
85
86func TestOPTIONS(t *testing.T) {
87 OPTIONS("/options", func(c *gin.Context) {

Callers

nothing calls this directly

Calls 3

PATCHFunction · 0.85
StringMethod · 0.65
ServeHTTPMethod · 0.45

Tested by

no test coverage detected