route wildcards suppoort substr

This commit is contained in:
Bel LaPointe
2022-06-17 14:22:51 -06:00
parent 643defd2f3
commit 75cb4b469b
2 changed files with 26 additions and 0 deletions

View File

@@ -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