OSDN Git Service

Update to current version of Go library (revision 94d654be2064).
[pf3gnuchains/gcc-fork.git] / libgo / go / regexp / all_test.go
index aed7330..c7ee4c8 100644 (file)
@@ -316,9 +316,9 @@ func TestNumSubexp(t *testing.T) {
 }
 
 func BenchmarkLiteral(b *testing.B) {
-       x := strings.Repeat("x", 50)
+       x := strings.Repeat("x", 50) + "y"
        b.StopTimer()
-       re := MustCompile(x)
+       re := MustCompile("y")
        b.StartTimer()
        for i := 0; i < b.N; i++ {
                if !re.MatchString(x) {
@@ -329,9 +329,9 @@ func BenchmarkLiteral(b *testing.B) {
 }
 
 func BenchmarkNotLiteral(b *testing.B) {
-       x := strings.Repeat("x", 49)
+       x := strings.Repeat("x", 50) + "y"
        b.StopTimer()
-       re := MustCompile("^" + x)
+       re := MustCompile(".y")
        b.StartTimer()
        for i := 0; i < b.N; i++ {
                if !re.MatchString(x) {