func TestTreeRouters(t *testing.T) {
	for _, r := range routers {
		shouldMatch := r.shouldMatchOrNot

		tr := NewTree()
		tr.AddRouter(r.pattern, "astaxie")
		ctx := context.NewContext()
		obj := tr.Match(r.requestUrl, ctx)
		if !shouldMatch {
			if obj != nil {
				t.Fatal("pattern:", r.pattern, ", should not match", r.requestUrl)
			} else {
				return
			}
		}
		if obj == nil || obj.(string) != "astaxie" {
			t.Fatal("pattern:", r.pattern+", can't match obj, Expect ", r.requestUrl)
		}
		if r.params != nil {
			for k, v := range r.params {
				if vv := ctx.Input.Param(k); vv != v {
					t.Fatal("The Rule: " + r.pattern + "\nThe RequestURL:" + r.requestUrl + "\nThe Key is " + k + ", The Value should be: " + v + ", but get: " + vv)
				} else if vv == "" && v != "" {
					t.Fatal(r.pattern + "    " + r.requestUrl + " get param empty:" + k)
				}
			}
		}
	}
}