|
|
@@ -7,6 +7,7 @@
|
|
|
package main
|
|
|
|
|
|
import (
|
|
|
+ "runtime"
|
|
|
"sync"
|
|
|
"testing"
|
|
|
)
|
|
|
@@ -14,10 +15,13 @@ import (
|
|
|
var predictableRandomTest sync.Once
|
|
|
|
|
|
func TestPredictableRandom(t *testing.T) {
|
|
|
+ if runtime.GOARCH != "amd64" {
|
|
|
+ t.Skip("Test only for 64 bit platforms; but if it works there, it should work on 32 bit")
|
|
|
+ }
|
|
|
predictableRandomTest.Do(func() {
|
|
|
// predictable random sequence is predictable
|
|
|
- e := 3440579354231278675
|
|
|
- if v := predictableRandom.Int(); v != e {
|
|
|
+ e := int64(3440579354231278675)
|
|
|
+ if v := int64(predictableRandom.Int()); v != e {
|
|
|
t.Errorf("Unexpected random value %d != %d", v, e)
|
|
|
}
|
|
|
})
|