Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
mf
go-multiaddr-fmt
Commits
b185ff62
Unverified
Commit
b185ff62
authored
May 20, 2021
by
Steven Allen
Committed by
GitHub
May 20, 2021
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #18 from multiformats/fix-dnsaddr-tests
fix dnsaddr test cases
parents
09029a4b
8ca908a1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
4 deletions
+7
-4
patterns_test.go
patterns_test.go
+7
-4
No files found.
patterns_test.go
View file @
b185ff62
...
...
@@ -57,8 +57,8 @@ var TestVectors = map[string]*testVector{
},
"DNS"
:
{
Pattern
:
DNS
,
Good
:
[]
string
{
"/dnsaddr/example.io"
,
"/dns4/example.io"
,
"/dns6/example.io"
,
"/dns/exmaple.io"
},
Bad
:
[]
string
{
"/ip4/127.0.0.1"
},
Good
:
[]
string
{
"/dns4/example.io"
,
"/dns6/example.io"
,
"/dns/exmaple.io"
},
Bad
:
[]
string
{
"/dnsaddr/example.io"
,
"/ip4/127.0.0.1"
},
},
"WebRTCDirect"
:
{
Pattern
:
WebRTCDirect
,
...
...
@@ -67,8 +67,8 @@ var TestVectors = map[string]*testVector{
},
"HTTP"
:
{
Pattern
:
HTTP
,
Good
:
[]
string
{
"/ip4/1.2.3.4/http"
,
"/dns4/example.io/http"
,
"/dns6/::/tcp/7011/http"
,
"/dnsaddr/example.io/http"
,
"/ip6/fc00::/http"
},
Bad
:
[]
string
{
"/ip4/1.2.3.4/https"
,
"/ip4/0.0.0.0/tcp/12345/quic"
,
"/ip6/fc00::/tcp/5523"
},
Good
:
[]
string
{
"/ip4/1.2.3.4/http"
,
"/dns4/example.io/http"
,
"/dns6/::/tcp/7011/http"
,
"/ip6/fc00::/http"
},
Bad
:
[]
string
{
"/ip4/1.2.3.4/https"
,
"/ip4/0.0.0.0/tcp/12345/quic"
,
"/ip6/fc00::/tcp/5523"
,
"/dnsaddr/example.io/http"
},
},
"HTTPS"
:
{
Pattern
:
HTTPS
,
...
...
@@ -79,6 +79,9 @@ var TestVectors = map[string]*testVector{
func
TestProtocolMatching
(
t
*
testing
.
T
)
{
for
name
,
tc
:=
range
TestVectors
{
name
:=
name
tc
:=
tc
t
.
Run
(
name
,
func
(
t
*
testing
.
T
)
{
t
.
Parallel
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment