summaryrefslogtreecommitdiff
path: root/src/pkg/runtime/append_test.go
diff options
context:
space:
mode:
authorOndřej Surý <ondrej@sury.org>2011-08-03 17:26:15 +0200
committerOndřej Surý <ondrej@sury.org>2011-08-03 17:31:49 +0200
commitb757d264230d65f988e08158e096a09497d39eb4 (patch)
treee20ec608a2ec8ebf603fa7aa060eb9723c4780b9 /src/pkg/runtime/append_test.go
parent5976088995f5c0d0bcada7d491fda4b6245e54e0 (diff)
downloadgolang-b757d264230d65f988e08158e096a09497d39eb4.tar.gz
Imported Upstream version 2011.07.29
Diffstat (limited to 'src/pkg/runtime/append_test.go')
-rw-r--r--src/pkg/runtime/append_test.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/pkg/runtime/append_test.go b/src/pkg/runtime/append_test.go
index 75a635306..b8552224e 100644
--- a/src/pkg/runtime/append_test.go
+++ b/src/pkg/runtime/append_test.go
@@ -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])