prysm-pulse/shared/rand/rand_test.go
Victor Farazdagi 78465e2549
QSP-6: Enforces crypto-secure PRNGs (#6401)
* adds cryptorand analyzer

* better naming

* rely on suffix

* sync/pending_* use crypto/rand

* define shared/rand

* updates fetcher

* fixes rand issue in sync package

* gofmt

* shared/rand: more docs + add exclusion nogo_config.json

* updates validator/assignments

* updates comment

* fixes remaning cases

* re-arranges comments

* fixes tests

* renames in shared/rand API

* adds simple no-panic test

* gazelle

Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
2020-06-26 09:58:47 -05:00

25 lines
501 B
Go

package rand
import (
"math/rand"
"testing"
)
func TestNewGenerator(t *testing.T) {
// Make sure that generation works, no panics.
randGen := NewGenerator()
_ = randGen.Int63()
_ = randGen.Uint64()
_ = randGen.Intn(32)
var _ = rand.Source64(randGen)
}
func TestNewDeterministicGenerator(t *testing.T) {
// Make sure that generation works, no panics.
randGen := NewDeterministicGenerator()
_ = randGen.Int63()
_ = randGen.Uint64()
_ = randGen.Intn(32)
var _ = rand.Source64(randGen)
}