mirror of
https://github.com/logos-messaging/go-multiaddr.git
synced 2026-01-08 16:03:06 +00:00
test: empty multiaddr
This commit is contained in:
parent
e3951368fb
commit
020c4d1741
@ -74,6 +74,8 @@ func TestConstructFails(t *testing.T) {
|
|||||||
"/unix",
|
"/unix",
|
||||||
"/ip4/1.2.3.4/tcp/80/unix",
|
"/ip4/1.2.3.4/tcp/80/unix",
|
||||||
"/ip4/127.0.0.1/tcp/9090/http/p2p-webcrt-direct",
|
"/ip4/127.0.0.1/tcp/9090/http/p2p-webcrt-direct",
|
||||||
|
"/",
|
||||||
|
"",
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, a := range cases {
|
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) {
|
func TestConstructSucceeds(t *testing.T) {
|
||||||
cases := []string{
|
cases := []string{
|
||||||
"/ip4/1.2.3.4",
|
"/ip4/1.2.3.4",
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user