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
Commits
020c4d17
Commit
020c4d17
authored
May 20, 2019
by
Steven Allen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
test: empty multiaddr
parent
e3951368
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
0 deletions
+9
-0
multiaddr_test.go
multiaddr_test.go
+9
-0
No files found.
multiaddr_test.go
View file @
020c4d17
...
...
@@ -74,6 +74,8 @@ func TestConstructFails(t *testing.T) {
"/unix"
,
"/ip4/1.2.3.4/tcp/80/unix"
,
"/ip4/127.0.0.1/tcp/9090/http/p2p-webcrt-direct"
,
"/"
,
""
,
}
for
_
,
a
:=
range
cases
{
...
...
@@ -83,6 +85,13 @@ func TestConstructFails(t *testing.T) {
}
}
func
TestEmptyMultiaddr
(
t
*
testing
.
T
)
{
_
,
err
:=
NewMultiaddrBytes
([]
byte
{})
if
err
==
nil
{
t
.
Fatal
(
"should have failed to parse empty multiaddr"
)
}
}
func
TestConstructSucceeds
(
t
*
testing
.
T
)
{
cases
:=
[]
string
{
"/ip4/1.2.3.4"
,
...
...
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