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

Function TestRouterGroupBadMethod

routergroup_test.go:145–168  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

143}
144
145func TestRouterGroupBadMethod(t *testing.T) {
146 router := New()
147 assert.Panics(t, func() {
148 router.Handle(http.MethodGet, "/")
149 })
150 assert.Panics(t, func() {
151 router.Handle(" GET", "/")
152 })
153 assert.Panics(t, func() {
154 router.Handle("GET ", "/")
155 })
156 assert.Panics(t, func() {
157 router.Handle("", "/")
158 })
159 assert.Panics(t, func() {
160 router.Handle("PO ST", "/")
161 })
162 assert.Panics(t, func() {
163 router.Handle("1GET", "/")
164 })
165 assert.Panics(t, func() {
166 router.Handle("PATCh", "/")
167 })
168}
169
170func TestRouterGroupPipeline(t *testing.T) {
171 router := New()

Callers

nothing calls this directly

Calls 2

NewFunction · 0.85
HandleMethod · 0.65

Tested by

no test coverage detected