1
0
mirror of https://github.com/ipfs/kubo.git synced 2025-07-15 07:58:15 +08:00
Files
kubo/core/bootstrap_test.go
Brian Tiger Chow f8a449953b fix(core) bootstrap panic
@jbenet @mappum

License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-12-08 18:04:41 -08:00

21 lines
401 B
Go

package core
import (
"testing"
peer "github.com/jbenet/go-ipfs/peer"
testutil "github.com/jbenet/go-ipfs/util/testutil"
)
func TestSubsetWhenMaxIsGreaterThanLengthOfSlice(t *testing.T) {
var ps []peer.Peer
sizeofSlice := 100
for i := 0; i < sizeofSlice; i++ {
ps = append(ps, testutil.RandPeer())
}
out := randomSubsetOfPeers(ps, 2*sizeofSlice)
if len(out) != len(ps) {
t.Fail()
}
}