Skip to content

Commit b185ff6

Browse files
authored
Merge pull request #18 from multiformats/fix-dnsaddr-tests
fix dnsaddr test cases
2 parents 09029a4 + 8ca908a commit b185ff6

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

patterns_test.go

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,8 @@ var TestVectors = map[string]*testVector{
5757
},
5858
"DNS": {
5959
Pattern: DNS,
60-
Good: []string{"/dnsaddr/example.io", "/dns4/example.io", "/dns6/example.io", "/dns/exmaple.io"},
61-
Bad: []string{"/ip4/127.0.0.1"},
60+
Good: []string{"/dns4/example.io", "/dns6/example.io", "/dns/exmaple.io"},
61+
Bad: []string{"/dnsaddr/example.io", "/ip4/127.0.0.1"},
6262
},
6363
"WebRTCDirect": {
6464
Pattern: WebRTCDirect,
@@ -67,8 +67,8 @@ var TestVectors = map[string]*testVector{
6767
},
6868
"HTTP": {
6969
Pattern: HTTP,
70-
Good: []string{"/ip4/1.2.3.4/http", "/dns4/example.io/http", "/dns6/::/tcp/7011/http", "/dnsaddr/example.io/http", "/ip6/fc00::/http"},
71-
Bad: []string{"/ip4/1.2.3.4/https", "/ip4/0.0.0.0/tcp/12345/quic", "/ip6/fc00::/tcp/5523"},
70+
Good: []string{"/ip4/1.2.3.4/http", "/dns4/example.io/http", "/dns6/::/tcp/7011/http", "/ip6/fc00::/http"},
71+
Bad: []string{"/ip4/1.2.3.4/https", "/ip4/0.0.0.0/tcp/12345/quic", "/ip6/fc00::/tcp/5523", "/dnsaddr/example.io/http"},
7272
},
7373
"HTTPS": {
7474
Pattern: HTTPS,
@@ -79,6 +79,9 @@ var TestVectors = map[string]*testVector{
7979

8080
func TestProtocolMatching(t *testing.T) {
8181
for name, tc := range TestVectors {
82+
name := name
83+
tc := tc
84+
8285
t.Run(name, func(t *testing.T) {
8386
t.Parallel()
8487

0 commit comments

Comments
 (0)