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
6a3fc2bc
Commit
6a3fc2bc
authored
Oct 22, 2017
by
Steven Allen
Committed by
GitHub
Oct 22, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #59 from multiformats/feat/test-bytes
Add test for Bytes()
parents
f5c34dfc
b11b0e54
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
0 deletions
+12
-0
multiaddr_test.go
multiaddr_test.go
+12
-0
No files found.
multiaddr_test.go
View file @
6a3fc2bc
...
...
@@ -420,3 +420,15 @@ func TestFuzzString(t *testing.T) {
}
}
}
func
TestBinaryRepresentation
(
t
*
testing
.
T
)
{
expected
:=
[]
byte
{
0x4
,
0x7f
,
0x0
,
0x0
,
0x1
,
0x91
,
0x2
,
0x4
,
0xd2
}
ma
,
err
:=
NewMultiaddr
(
"/ip4/127.0.0.1/udp/1234"
)
if
err
!=
nil
{
t
.
Error
(
err
)
}
if
!
bytes
.
Equal
(
ma
.
Bytes
(),
expected
)
{
t
.
Errorf
(
"expected %x, got %x"
,
expected
,
ma
.
Bytes
())
}
}
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