| 936 | } |
| 937 | |
| 938 | func TestWithOptionFunc(t *testing.T) { |
| 939 | r := New() |
| 940 | |
| 941 | r.With(func(e *Engine) { |
| 942 | e.GET("/test1", handlerTest1) |
| 943 | e.GET("/test2", handlerTest2) |
| 944 | |
| 945 | e.Use(func(c *Context) { |
| 946 | c.Next() |
| 947 | }) |
| 948 | }) |
| 949 | |
| 950 | routes := r.Routes() |
| 951 | assertRoutePresent(t, routes, RouteInfo{Path: "/test1", Method: http.MethodGet, Handler: "github.com/gin-gonic/gin.handlerTest1"}) |
| 952 | assertRoutePresent(t, routes, RouteInfo{Path: "/test2", Method: http.MethodGet, Handler: "github.com/gin-gonic/gin.handlerTest2"}) |
| 953 | } |
| 954 | |
| 955 | type Birthday string |
| 956 | |