2020-06-26 14:58:47 +00:00
|
|
|
package rand
|
|
|
|
|
|
|
|
import (
|
|
|
|
"math/rand"
|
|
|
|
"testing"
|
|
|
|
)
|
|
|
|
|
2021-09-20 20:51:59 +00:00
|
|
|
func TestNewGenerator(_ *testing.T) {
|
2020-06-26 14:58:47 +00:00
|
|
|
// Make sure that generation works, no panics.
|
|
|
|
randGen := NewGenerator()
|
|
|
|
_ = randGen.Int63()
|
|
|
|
_ = randGen.Uint64()
|
|
|
|
_ = randGen.Intn(32)
|
|
|
|
var _ = rand.Source64(randGen)
|
|
|
|
}
|
|
|
|
|
2021-09-20 20:51:59 +00:00
|
|
|
func TestNewDeterministicGenerator(_ *testing.T) {
|
2020-06-26 14:58:47 +00:00
|
|
|
// Make sure that generation works, no panics.
|
|
|
|
randGen := NewDeterministicGenerator()
|
|
|
|
_ = randGen.Int63()
|
|
|
|
_ = randGen.Uint64()
|
|
|
|
_ = randGen.Intn(32)
|
|
|
|
var _ = rand.Source64(randGen)
|
|
|
|
}
|