Add resolver for outbound dialer

This commit is contained in:
世界
2022-07-07 21:47:21 +08:00
parent d921797e3c
commit f65f3f1ba0
32 changed files with 1058 additions and 222 deletions

View File

@@ -1,14 +1,16 @@
package domain
package domain_test
import (
"testing"
"github.com/sagernet/sing-box/common/domain"
"github.com/stretchr/testify/require"
)
func TestMatch(t *testing.T) {
r := require.New(t)
matcher := NewMatcher([]string{"domain.com"}, []string{"suffix.com", ".suffix.org"})
matcher := domain.NewMatcher([]string{"domain.com"}, []string{"suffix.com", ".suffix.org"})
r.True(matcher.Match("domain.com"))
r.False(matcher.Match("my.domain.com"))
r.True(matcher.Match("suffix.com"))