MCPcopy Create free account
hub / github.com/benbjohnson/immutable / RunRandom

Function RunRandom

immutable_test.go:2492–2505  ·  view source on GitHub ↗

RunRandom executes fn multiple times with a different rand.

(t *testing.T, name string, fn func(t *testing.T, rand *rand.Rand))

Source from the content-addressed store, hash-verified

2490
2491// RunRandom executes fn multiple times with a different rand.
2492func 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
2507func uniqueIntSlice(a []int) []int {
2508 m := make(map[int]struct{})

Callers 8

TestListFunction · 0.85
TestMap_SetFunction · 0.85
TestMap_DeleteFunction · 0.85
TestSortedMap_SetFunction · 0.85
TestSortedMap_DeleteFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…