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

Function TestGroup_StaticPanic

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

Source from the content-addressed store, hash-verified

711}
712
713func TestGroup_StaticPanic(t *testing.T) {
714 var testCases = []struct {
715 name string
716 givenRoot string
717 }{
718 {
719 name: "panics for ../",
720 givenRoot: "../images",
721 },
722 {
723 name: "panics for /",
724 givenRoot: "/images",
725 },
726 }
727
728 for _, tc := range testCases {
729 t.Run(tc.name, func(t *testing.T) {
730 e := New()
731 e.Filesystem = os.DirFS("./")
732
733 g := e.Group("/assets")
734
735 assert.Panics(t, func() {
736 g.Static("/images", tc.givenRoot)
737 })
738 })
739 }
740}
741
742func TestGroup_RouteNotFoundWithMiddleware(t *testing.T) {
743 var testCases = []struct {

Callers

nothing calls this directly

Calls 3

NewFunction · 0.85
GroupMethod · 0.45
StaticMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…