diff --git a/src/pkg/regexp/exec_test.go b/src/pkg/regexp/exec_test.go index f6fcd4be4ac0da..555e06e826dd8a 100644 --- a/src/pkg/regexp/exec_test.go +++ b/src/pkg/regexp/exec_test.go @@ -9,7 +9,6 @@ import ( "compress/bzip2" "fmt" "io" - "math/rand" "os" "path/filepath" "regexp/syntax" @@ -643,11 +642,17 @@ func makeText(n int) []byte { return text[:n] } text = make([]byte, n) + x := ^uint32(0) for i := range text { - if rand.Intn(30) == 0 { + x += x + x ^= 1 + if int32(x) < 0 { + x ^= 0x88888eef + } + if x%31 == 0 { text[i] = '\n' } else { - text[i] = byte(rand.Intn(0x7E+1-0x20) + 0x20) + text[i] = byte(x%(0x7E+1-0x20) + 0x20) } } return text