1
0
mirror of https://github.com/astaxie/beego.git synced 2025-08-01 00:15:31 +00:00
This commit is contained in:
ysqi
2016-02-12 14:45:45 +08:00
parent 2b23764ee0
commit 9411063574
2 changed files with 16 additions and 5 deletions

View File

@@ -221,6 +221,18 @@ func TestAddTree4(t *testing.T) {
}
}
// Test for issue #1595
func TestAddTree5(t *testing.T) {
tr := NewTree()
tr.AddRouter("/v1/shop/:id", "shopdetail")
tr.AddRouter("/v1/shop/", "shophome")
ctx := context.NewContext()
obj := tr.Match("/v1/shop/", ctx)
if obj == nil || obj.(string) != "shophome" {
t.Fatal("url /v1/shop/ need match router /v1/shop/ ")
}
}
func TestSplitPath(t *testing.T) {
a := splitPath("")
if len(a) != 0 {