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

Function TestEcho_Any

echo_test.go:911–926  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

909}
910
911func TestEcho_Any(t *testing.T) {
912 e := New()
913
914 ri := e.Any("/activate", func(c *Context) error {
915 return c.String(http.StatusTeapot, "OK from ANY")
916 })
917
918 assert.Equal(t, RouteAny, ri.Method)
919 assert.Equal(t, "/activate", ri.Path)
920 assert.Equal(t, RouteAny+":/activate", ri.Name)
921 assert.Nil(t, ri.Parameters)
922
923 status, body := request(http.MethodTrace, "/activate", e)
924 assert.Equal(t, http.StatusTeapot, status)
925 assert.Equal(t, `OK from ANY`, body)
926}
927
928func TestEcho_Any_hasLowerPriority(t *testing.T) {
929 e := New()

Callers

nothing calls this directly

Calls 4

NewFunction · 0.85
requestFunction · 0.85
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…