RunRandom executes fn multiple times with a different rand.
(t *testing.T, name string, fn func(t *testing.T, rand *rand.Rand))
| 2490 | |
| 2491 | // RunRandom executes fn multiple times with a different rand. |
| 2492 | func RunRandom(t *testing.T, name string, fn func(t *testing.T, rand *rand.Rand)) { |
| 2493 | if testing.Short() { |
| 2494 | t.Skip("short mode") |
| 2495 | } |
| 2496 | t.Run(name, func(t *testing.T) { |
| 2497 | for i := 0; i < *randomN; i++ { |
| 2498 | i := i |
| 2499 | t.Run(fmt.Sprintf("%08d", i), func(t *testing.T) { |
| 2500 | t.Parallel() |
| 2501 | fn(t, rand.New(rand.NewSource(int64(i)))) |
| 2502 | }) |
| 2503 | } |
| 2504 | }) |
| 2505 | } |
| 2506 | |
| 2507 | func uniqueIntSlice(a []int) []int { |
| 2508 | m := make(map[int]struct{}) |
no outgoing calls
no test coverage detected
searching dependent graphs…