From fc8b58001754ec543f6738adc9efbea6f88c2d71 Mon Sep 17 00:00:00 2001 From: JimhHan <50871214+JimhHan@users.noreply.github.com> Date: Fri, 26 Mar 2021 17:19:09 +0800 Subject: [PATCH] Fix: tests --- app/proxyman/config.go | 4 ++++ app/router/condition_test.go | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/app/proxyman/config.go b/app/proxyman/config.go index 302d208f..16506627 100644 --- a/app/proxyman/config.go +++ b/app/proxyman/config.go @@ -53,6 +53,10 @@ type SniffingMatcher struct { func NewSniffingMatcher(sc *SniffingConfig) (*SniffingMatcher, error) { m := new(SniffingMatcher) + if sc == nil { + return m, nil + } + if sc.DomainsExcluded != nil { exDomain, err := domain.NewDomainMatcher(sc.DomainsExcluded) if err != nil { diff --git a/app/router/condition_test.go b/app/router/condition_test.go index 2ee1c020..e4f20341 100644 --- a/app/router/condition_test.go +++ b/app/router/condition_test.go @@ -359,7 +359,7 @@ func TestChinaSites(t *testing.T) { domains, err := loadGeoSite("CN") common.Must(err) - matcher, err := NewDomainMatcher(domains) + matcher, err := domain.NewDomainMatcher(domains) common.Must(err) type TestCase struct {