tests(peer) ensure String() works when p created WithId presently, fails
tests(peer) ensure String() works when p created WithId presently, fails
Brian Tiger Chow committed
Oct 28, 2014 at 00:29 UTC
0c530bf5f1106e2f4fcea83e9597cc4fa5fbc55d
1 file changed
+9
peer/peer_test.go
+9
@@ -46,3 +46,12 @@ func TestNetAddress(t *testing.T) {
46
t.Error("NetAddress lookup failed", udp, udp2)
47
}
48
}
49
+
50
+func TestStringMethodWithSmallId(t *testing.T) {
51
+ p := WithID([]byte(string(0)))
52
+ p1, ok := p.(*peer)
53
+ if !ok {
54
+ t.Fatal("WithID doesn't return a peer")
55
+ }
56
+ p1.String()
57
+}