mirror of
https://github.com/sot-tech/mochi.git
synced 2026-04-28 08:29:59 -07:00
make infohash and peerID byte arrays (#169)
This commit is contained in:
committed by
Jimmy Zelinskie
parent
a081e5195b
commit
7f16c55d81
@@ -34,10 +34,10 @@ func TestPeer(t *testing.T) {
|
||||
}
|
||||
|
||||
p := Peer(r, "abcdefghijklmnopqrst", false, 2000, 2000)
|
||||
assert.Equal(t, "abcdefghijklmnopqrst", string(p.ID))
|
||||
assert.Equal(t, "abcdefghijklmnopqrst", string(p.ID[:]))
|
||||
assert.Equal(t, uint16(2000), p.Port)
|
||||
|
||||
p = Peer(r, "abcdefghijklmnopqrstUVWXYZ", true, -10, -5)
|
||||
assert.Equal(t, "abcdefghijklmnopqrst", string(p.ID))
|
||||
assert.Equal(t, "abcdefghijklmnopqrst", string(p.ID[:]))
|
||||
assert.True(t, p.Port >= uint16(1) && p.Port <= uint16(65535))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user