Commit 020c4d17 authored by Steven Allen's avatar Steven Allen

test: empty multiaddr

parent e3951368
......@@ -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",
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment