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
1b2246d7
Commit
1b2246d7
authored
Sep 12, 2019
by
Steven Allen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
test: test unix addrs
parent
a5c136c9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
0 deletions
+14
-0
convert_test.go
convert_test.go
+14
-0
No files found.
convert_test.go
View file @
1b2246d7
...
...
@@ -64,6 +64,20 @@ func TestFromIP4(t *testing.T) {
})
}
func
TestFromUnix
(
t
*
testing
.
T
)
{
testConvert
(
t
,
"/unix/c:/foo/bar"
,
func
()
(
ma
.
Multiaddr
,
error
)
{
return
FromNetAddr
(
&
net
.
UnixAddr
{
Name
:
"/c:/foo/bar"
,
Net
:
"unix"
})
})
testConvert
(
t
,
"/unix/foo/bar"
,
func
()
(
ma
.
Multiaddr
,
error
)
{
return
FromNetAddr
(
&
net
.
UnixAddr
{
Name
:
"/foo/bar"
,
Net
:
"unix"
})
})
}
func
TestToUnix
(
t
*
testing
.
T
)
{
testToNetAddr
(
t
,
"/unix/c:/foo/bar"
,
"unix"
,
"/c:/foo/bar"
)
testToNetAddr
(
t
,
"/unix/foo/bar"
,
"unix"
,
"/foo/bar"
)
}
func
TestFromIP6
(
t
*
testing
.
T
)
{
testConvert
(
t
,
"/ip6/2001:4860:0:2001::68"
,
func
()
(
ma
.
Multiaddr
,
error
)
{
return
FromNetAddr
(
&
net
.
IPAddr
{
IP
:
net
.
ParseIP
(
"2001:4860:0:2001::68"
)})
...
...
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