mirror of
https://github.com/waku-org/go-multiaddr.git
synced 2025-02-22 19:18:14 +00:00
test: empty multiaddr
This commit is contained in:
parent
e3951368fb
commit
020c4d1741
@ -74,6 +74,8 @@ func TestConstructFails(t *testing.T) {
|
||||
"/unix",
|
||||
"/ip4/1.2.3.4/tcp/80/unix",
|
||||
"/ip4/127.0.0.1/tcp/9090/http/p2p-webcrt-direct",
|
||||
"/",
|
||||
"",
|
||||
}
|
||||
|
||||
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) {
|
||||
cases := []string{
|
||||
"/ip4/1.2.3.4",
|
||||
|
Loading…
x
Reference in New Issue
Block a user