mirror of
https://github.com/logos-messaging/go-multiaddr.git
synced 2026-01-02 13:03:11 +00:00
test: test unix addrs
This commit is contained in:
parent
a5c136c974
commit
1b2246d7be
@ -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")})
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user