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

Function TestEcho_StaticPanic

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

Source from the content-addressed store, hash-verified

536}
537
538func TestEcho_StaticPanic(t *testing.T) {
539 var testCases = []struct {
540 name string
541 givenRoot string
542 }{
543 {
544 name: "panics for ../",
545 givenRoot: "../assets",
546 },
547 {
548 name: "panics for /",
549 givenRoot: "/assets",
550 },
551 }
552
553 for _, tc := range testCases {
554 t.Run(tc.name, func(t *testing.T) {
555 e := New()
556 e.Filesystem = os.DirFS("./")
557
558 assert.Panics(t, func() {
559 e.Static("../assets", tc.givenRoot)
560 })
561 })
562 }
563}
564
565func TestEchoStaticRedirectIndex(t *testing.T) {
566 e := New()

Callers

nothing calls this directly

Calls 2

NewFunction · 0.85
StaticMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…