diff options
author | ian <ian@138bc75d-0d04-0410-961f-82ee72b054a4> | 2013-11-06 19:49:01 +0000 |
---|---|---|
committer | ian <ian@138bc75d-0d04-0410-961f-82ee72b054a4> | 2013-11-06 19:49:01 +0000 |
commit | 0ce10ea1348e9afd5d0eec6bca986bfe58bac5ac (patch) | |
tree | 39530b071991b2326f881b2a30a2d82d6c133fd6 /libgo/go/regexp/exec_test.go | |
parent | 57a8bf1b0c6057ccbacb0cf79eb84d1985c2c1fe (diff) |
libgo: Update to October 24 version of master library.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@204466 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libgo/go/regexp/exec_test.go')
-rw-r--r-- | libgo/go/regexp/exec_test.go | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/libgo/go/regexp/exec_test.go b/libgo/go/regexp/exec_test.go index 9dfaed713f70..70d069c06110 100644 --- a/libgo/go/regexp/exec_test.go +++ b/libgo/go/regexp/exec_test.go @@ -9,7 +9,6 @@ import ( "compress/bzip2" "fmt" "io" - "math/rand" "os" "path/filepath" "regexp/syntax" @@ -67,13 +66,6 @@ func TestRE2Search(t *testing.T) { testRE2(t, "testdata/re2-search.txt") } -func TestRE2Exhaustive(t *testing.T) { - if testing.Short() { - t.Skip("skipping TestRE2Exhaustive during short test") - } - testRE2(t, "testdata/re2-exhaustive.txt.bz2") -} - func testRE2(t *testing.T, file string) { f, err := os.Open(file) if err != nil { @@ -650,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 @@ -691,7 +689,7 @@ func BenchmarkMatchEasy1_1K(b *testing.B) { benchmark(b, easy1, 1<<10) } func BenchmarkMatchEasy1_32K(b *testing.B) { benchmark(b, easy1, 32<<10) } func BenchmarkMatchEasy1_1M(b *testing.B) { benchmark(b, easy1, 1<<20) } func BenchmarkMatchEasy1_32M(b *testing.B) { benchmark(b, easy1, 32<<20) } -func BenchmarkMatchMedium_32(b *testing.B) { benchmark(b, medium, 1<<0) } +func BenchmarkMatchMedium_32(b *testing.B) { benchmark(b, medium, 32<<0) } func BenchmarkMatchMedium_1K(b *testing.B) { benchmark(b, medium, 1<<10) } func BenchmarkMatchMedium_32K(b *testing.B) { benchmark(b, medium, 32<<10) } func BenchmarkMatchMedium_1M(b *testing.B) { benchmark(b, medium, 1<<20) } |