tests(peer) ensure String() works when p created WithId

presently, fails
This commit is contained in:
Brian Tiger Chow 2014-10-28 00:29:30 -07:00 committed by Juan Batiz-Benet
parent 1840a01fdc
commit 0c530bf5f1

View File

@ -46,3 +46,12 @@ func TestNetAddress(t *testing.T) {
t.Error("NetAddress lookup failed", udp, udp2)
}
}
func TestStringMethodWithSmallId(t *testing.T) {
p := WithID([]byte(string(0)))
p1, ok := p.(*peer)
if !ok {
t.Fatal("WithID doesn't return a peer")
}
p1.String()
}