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

Function checkUnusedParamValues

router_test.go:659–672  ·  view source on GitHub ↗
(t *testing.T, c *Context, expectParam map[string]string)

Source from the content-addressed store, hash-verified

657)
658
659func checkUnusedParamValues(t *testing.T, c *Context, expectParam map[string]string) {
660 for _, p := range c.PathValues() {
661 value := p.Value
662 if value != "" {
663 if expectParam == nil {
664 t.Errorf("pValue '%v' is set for param name '%v' but we are not expecting it with expectParam", value, p)
665 } else {
666 if _, ok := expectParam[p.Name]; !ok {
667 t.Errorf("pValue '%v' is set for param name '%v' but we are not expecting it with expectParam", value, p)
668 }
669 }
670 }
671 }
672}
673
674func TestRouterFillsRequestPatternField(t *testing.T) {
675 path := "/folders/a/files/echo.gif"

Calls 1

PathValuesMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…