Initial commit
This commit is contained in:
22
vendor/github.com/hyperhq/hypercli/pkg/random/random_test.go
generated
vendored
Normal file
22
vendor/github.com/hyperhq/hypercli/pkg/random/random_test.go
generated
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
package random
|
||||
|
||||
import (
|
||||
"math/rand"
|
||||
"sync"
|
||||
"testing"
|
||||
)
|
||||
|
||||
// for go test -v -race
|
||||
func TestConcurrency(t *testing.T) {
|
||||
rnd := rand.New(NewSource())
|
||||
var wg sync.WaitGroup
|
||||
|
||||
for i := 0; i < 10; i++ {
|
||||
wg.Add(1)
|
||||
go func() {
|
||||
rnd.Int63()
|
||||
wg.Done()
|
||||
}()
|
||||
}
|
||||
wg.Wait()
|
||||
}
|
||||
Reference in New Issue
Block a user