Skip to content

Commit

Permalink
In Go 1.22 finding name of function with reflection has changed. chan…
Browse files Browse the repository at this point in the history
…ge tests to work with that.
  • Loading branch information
aldas committed Feb 7, 2024
1 parent 51f321e commit 03e7ef6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions echo_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1572,7 +1572,7 @@ func TestEcho_OnAddRouteHandler(t *testing.T) {
})
}

e.GET("/static", NotFoundHandler)
e.GET("/static", dummyHandler)
e.Host("domain.site").GET("/static/*", dummyHandler, func(next HandlerFunc) HandlerFunc {
return func(c Context) error {
return next(c)
Expand All @@ -1582,7 +1582,7 @@ func TestEcho_OnAddRouteHandler(t *testing.T) {
assert.Len(t, added, 2)

assert.Equal(t, "", added[0].host)
assert.Equal(t, Route{Method: http.MethodGet, Path: "/static", Name: "github.com/labstack/echo/v4.glob..func1"}, added[0].route)
assert.Equal(t, Route{Method: http.MethodGet, Path: "/static", Name: "github.com/labstack/echo/v4.TestEcho_OnAddRouteHandler.func1"}, added[0].route)
assert.Len(t, added[0].middleware, 0)

assert.Equal(t, "domain.site", added[1].host)
Expand Down

0 comments on commit 03e7ef6

Please sign in to comment.