Fix: tests

This commit is contained in:
JimhHan 2021-03-26 17:19:09 +08:00
parent 06fc82bad1
commit fc8b580017
No known key found for this signature in database
GPG Key ID: 48D5D7CF95157AC5
2 changed files with 5 additions and 1 deletions

View File

@ -53,6 +53,10 @@ type SniffingMatcher struct {
func NewSniffingMatcher(sc *SniffingConfig) (*SniffingMatcher, error) { func NewSniffingMatcher(sc *SniffingConfig) (*SniffingMatcher, error) {
m := new(SniffingMatcher) m := new(SniffingMatcher)
if sc == nil {
return m, nil
}
if sc.DomainsExcluded != nil { if sc.DomainsExcluded != nil {
exDomain, err := domain.NewDomainMatcher(sc.DomainsExcluded) exDomain, err := domain.NewDomainMatcher(sc.DomainsExcluded)
if err != nil { if err != nil {

View File

@ -359,7 +359,7 @@ func TestChinaSites(t *testing.T) {
domains, err := loadGeoSite("CN") domains, err := loadGeoSite("CN")
common.Must(err) common.Must(err)
matcher, err := NewDomainMatcher(domains) matcher, err := domain.NewDomainMatcher(domains)
common.Must(err) common.Must(err)
type TestCase struct { type TestCase struct {