]> Cypherpunks repositories - gostls13.git/commitdiff
runtime: make TestSideEffectOrder work twice
authorRuss Cox <rsc@golang.org>
Fri, 15 Jul 2011 03:43:03 +0000 (23:43 -0400)
committerRuss Cox <rsc@golang.org>
Fri, 15 Jul 2011 03:43:03 +0000 (23:43 -0400)
R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/4714045

src/pkg/runtime/append_test.go

index 75a635306b7769911b5243410d6ba79bfd351568..b8552224e5b881532439608958aa1bb64dc8a575 100644 (file)
@@ -36,7 +36,7 @@ func BenchmarkAppendSpecialCase(b *testing.B) {
        }
 }
 
-var x = make([]int, 0, 10)
+var x []int
 
 func f() int {
        x[:1][0] = 3
@@ -44,6 +44,7 @@ func f() int {
 }
 
 func TestSideEffectOrder(t *testing.T) {
+       x = make([]int, 0, 10)
        x = append(x, 1, f())
        if x[0] != 1 || x[1] != 2 {
                t.Error("append failed: ", x[0], x[1])