1
0
mirror of https://github.com/labstack/echo.git synced 2024-12-24 20:14:31 +02:00

fixed broken build

Signed-off-by: Vishal Rana <vr@labstack.com>
This commit is contained in:
Vishal Rana 2015-04-11 13:52:40 -07:00
parent 9f41bbedec
commit eca5d87221
2 changed files with 12 additions and 3 deletions

View File

@ -209,10 +209,7 @@ func (r *router) Find(method, path string, params Params) (h HandlerFunc, echo *
search = "" // End search
continue
}
if tn != nil {
}
println(tn.handler, tn.prefix)
return
}
}

View File

@ -344,6 +344,18 @@ func TestRouterMicroParam(t *testing.T) {
}
}
func TestRouterConflict(t *testing.T) {
r := New().Router
r.Add(GET, "/users", func(*Context) {}, nil)
r.Add(GET, "/users/new", func(*Context) {}, nil)
r.Add(GET, "/users/old", func(*Context) {}, nil)
r.Add(GET, "/users/:id", func(*Context) {}, nil)
h, _ := r.Find(GET, "/users/nnn", params)
println(h)
n := r.trees[GET]
n.printTree("", true)
}
func TestRouterAPI(t *testing.T) {
r := New().Router
for _, route := range api {