Fix: domain trie search

This commit is contained in:
Dreamacro
2022-01-26 22:28:13 +08:00
parent cfe7354c07
commit b1a639feae
3 changed files with 11 additions and 3 deletions

View File

@ -97,3 +97,11 @@ func TestTrie_Boundary(t *testing.T) {
assert.NotNil(t, tree.Insert("..dev", localIP))
assert.Nil(t, tree.Search("dev"))
}
func TestTrie_WildcardBoundary(t *testing.T) {
tree := New()
tree.Insert("+.*", localIP)
tree.Insert("stun.*.*.*", localIP)
assert.NotNil(t, tree.Search("example.com"))
}