Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(622)

Unified Diff: common/data/rand/mathrand/mathrand_test.go

Issue 2588213002: Use global rand.Rand instance in mathrand. (Closed)
Patch Set: Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: common/data/rand/mathrand/mathrand_test.go
diff --git a/common/data/rand/mathrand/mathrand_test.go b/common/data/rand/mathrand/mathrand_test.go
index 7138be652d21197f50057a77bdc0edebb97e8923..72bb8b468998ceab1b55d956cfee58cb8913fcb7 100644
--- a/common/data/rand/mathrand/mathrand_test.go
+++ b/common/data/rand/mathrand/mathrand_test.go
@@ -22,6 +22,10 @@ func Test(t *testing.T) {
Convey("unset", func() {
// Just ensure doesn't crash.
So(Get(c).Int()+1 > 0, ShouldBeTrue)
+ So(WithGoRand(c, func(r *rand.Rand) error {
+ So(r.Int(), ShouldBeGreaterThanOrEqualTo, 0)
+ return nil
+ }), ShouldBeNil)
})
Convey("set persistance", func() {
« common/data/rand/mathrand/mathrand.go ('K') | « common/data/rand/mathrand/mathrand.go ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698