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
1e80322c
Commit
1e80322c
authored
Jun 18, 2018
by
Steven Allen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add test case for panic
parent
1e4c6be7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
0 deletions
+14
-0
multiaddr_test.go
multiaddr_test.go
+14
-0
No files found.
multiaddr_test.go
View file @
1e80322c
...
...
@@ -478,3 +478,17 @@ func TestIPFSvP2P(t *testing.T) {
}
}
}
func
TestInvalidP2PAddr
(
t
*
testing
.
T
)
{
badAddr
:=
"a503221221c05877cbae039d70a5e600ea02c6f9f2942439285c9e344e26f8d280c850fad6"
bts
,
err
:=
hex
.
DecodeString
(
badAddr
)
if
err
!=
nil
{
t
.
Fatal
(
err
)
}
ma
,
err
:=
NewMultiaddrBytes
(
bts
)
if
err
==
nil
{
t
.
Error
(
"should have failed"
)
// Check for panic
_
=
ma
.
String
()
}
}
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