| // Copyright 2016 The Go Authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style |
| // license that can be found in the LICENSE file. |
| // TestConcurrent exercises the rand API concurrently, triggering situations |
| // where the race detector is likely to detect issues. |
| func TestConcurrent(t *testing.T) { |
| for i := 0; i < numRoutines; i++ { |
| for j := 0; j < numCycles; j++ { |
| seed += int64(ExpFloat64()) |
| seed += int64(Intn(Int())) |
| seed += int64(Int31n(Int31())) |
| seed += int64(Int63n(Int63())) |
| seed += int64(NormFloat64()) |
| for _, p := range Perm(10) { |