ReadTestdataBytes reads random bytes, but then nudges them into printable ASCII, *reducing their randomness* to make them a little friendlier for humans using them as testdata.
(r *rand.Rand, arr []byte)
| 66 | // ASCII, *reducing their randomness* to make them a little friendlier for |
| 67 | // humans using them as testdata. |
| 68 | func ReadTestdataBytes(r *rand.Rand, arr []byte) { |
| 69 | _, _ = r.Read(arr) |
| 70 | for i := range arr { |
| 71 | arr[i] = arr[i] & 0x7F // mask out non-ascii |
| 72 | if arr[i] < ' ' { // Nudge the control chars up, into the letters. |
| 73 | arr[i] += 'A' |
| 74 | } |
| 75 | } |
| 76 | } |
| 77 | |
| 78 | // SeedForTests seeds the random number generator and prints the seed |
| 79 | // value used. This value can be specified via an environment variable |
nothing calls this directly
no test coverage detected
searching dependent graphs…