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

Function TestGroup_Match

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

Source from the content-addressed store, hash-verified

390}
391
392func TestGroup_Match(t *testing.T) {
393 e := New()
394
395 myMethods := []string{http.MethodGet, http.MethodPost}
396 users := e.Group("/users")
397 ris := users.Match(myMethods, "/activate", func(c *Context) error {
398 return c.String(http.StatusTeapot, "OK")
399 })
400 assert.Len(t, ris, 2)
401
402 for _, m := range myMethods {
403 status, body := request(m, "/users/activate", e)
404 assert.Equal(t, http.StatusTeapot, status)
405 assert.Equal(t, `OK`, body)
406 }
407}
408
409func TestGroup_MatchWithErrors(t *testing.T) {
410 e := New()

Callers

nothing calls this directly

Calls 5

NewFunction · 0.85
requestFunction · 0.85
GroupMethod · 0.45
MatchMethod · 0.45
StringMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…