Commit 1e80322c authored by Steven Allen's avatar Steven Allen

add test case for panic

parent 1e4c6be7
......@@ -478,3 +478,17 @@ func TestIPFSvP2P(t *testing.T) {
}
}
}
func TestInvalidP2PAddr(t *testing.T) {
badAddr := "a503221221c05877cbae039d70a5e600ea02c6f9f2942439285c9e344e26f8d280c850fad6"
bts, err := hex.DecodeString(badAddr)
if err != nil {
t.Fatal(err)
}
ma, err := NewMultiaddrBytes(bts)
if err == nil {
t.Error("should have failed")
// Check for panic
_ = ma.String()
}
}
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