提升通过域名查找服务的性能,轻松支持海量域名

This commit is contained in:
刘祥超
2021-11-15 16:56:31 +08:00
parent a95fe17ebc
commit f4edd45886
6 changed files with 310 additions and 26 deletions

View File

@@ -81,3 +81,14 @@ func TestMatchDomain(t *testing.T) {
a.IsTrue(ok)
}
}
func TestIsSpecialDomain(t *testing.T) {
var a = assert.NewAssertion(t)
a.IsTrue(IsFuzzyDomain(""))
a.IsTrue(IsFuzzyDomain(".hello.com"))
a.IsTrue(IsFuzzyDomain("*.hello.com"))
a.IsTrue(IsFuzzyDomain("hello.*.com"))
a.IsTrue(IsFuzzyDomain("~^hello\\.com"))
a.IsFalse(IsFuzzyDomain("hello.com"))
}