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

Function TestGroup_Any

group_test.go:374–390  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

372}
373
374func TestGroup_Any(t *testing.T) {
375 e := New()
376
377 users := e.Group("/users")
378 ri := users.Any("/activate", func(c *Context) error {
379 return c.String(http.StatusTeapot, "OK from ANY")
380 })
381
382 assert.Equal(t, RouteAny, ri.Method)
383 assert.Equal(t, "/users/activate", ri.Path)
384 assert.Equal(t, RouteAny+":/users/activate", ri.Name)
385 assert.Nil(t, ri.Parameters)
386
387 status, body := request(http.MethodTrace, "/users/activate", e)
388 assert.Equal(t, http.StatusTeapot, status)
389 assert.Equal(t, `OK from ANY`, body)
390}
391
392func TestGroup_Match(t *testing.T) {
393 e := New()

Callers

nothing calls this directly

Calls 5

NewFunction · 0.85
requestFunction · 0.85
GroupMethod · 0.45
AnyMethod · 0.45
StringMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…