route wildcards suppoort substr
This commit is contained in:
12
tree_test.go
12
tree_test.go
@@ -82,6 +82,18 @@ func TestTreeInsertLookup(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestTreeWildcardSubstr(t *testing.T) {
|
||||
tree := newTree()
|
||||
foo := func(w http.ResponseWriter, r *http.Request) {
|
||||
}
|
||||
if err := tree.Insert("/prefix-"+Wildcard, foo); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if foo := tree.Lookup("/prefix-suffix"); foo == nil {
|
||||
t.Error(foo)
|
||||
}
|
||||
}
|
||||
|
||||
func TestTreeWildcard(t *testing.T) {
|
||||
tree := newTree()
|
||||
checked := false
|
||||
|
||||
Reference in New Issue
Block a user