testing.go 227 B

12345678910111213141516
  1. package lru
  2. import (
  3. "crypto/rand"
  4. "math"
  5. "math/big"
  6. "testing"
  7. )
  8. func getRand(tb testing.TB) int64 {
  9. out, err := rand.Int(rand.Reader, big.NewInt(math.MaxInt64))
  10. if err != nil {
  11. tb.Fatal(err)
  12. }
  13. return out.Int64()
  14. }