all: sync with master; upd chlog
This commit is contained in:
@@ -1,15 +1,15 @@
|
||||
package dnsforward
|
||||
|
||||
import (
|
||||
"sort"
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
"golang.org/x/exp/slices"
|
||||
)
|
||||
|
||||
func TestAnyNameMatches(t *testing.T) {
|
||||
dnsNames := []string{"host1", "*.host2", "1.2.3.4"}
|
||||
sort.Strings(dnsNames)
|
||||
slices.Sort(dnsNames)
|
||||
|
||||
testCases := []struct {
|
||||
name string
|
||||
@@ -31,6 +31,10 @@ func TestAnyNameMatches(t *testing.T) {
|
||||
name: "match",
|
||||
dnsName: "1.2.3.4",
|
||||
want: true,
|
||||
}, {
|
||||
name: "mismatch_bad_ip",
|
||||
dnsName: "1.2.3.256",
|
||||
want: false,
|
||||
}, {
|
||||
name: "mismatch",
|
||||
dnsName: "host2",
|
||||
|
||||
Reference in New Issue
Block a user