all: make tests able to run multiple times.
It is now possible to run "go test -cpu=1,2,4 std"
successfully.
Fixes #3185.
R=golang-dev, dave, minux.ma, bradfitz
CC=golang-dev
https://golang.org/cl/7196052
diff --git a/src/pkg/expvar/expvar_test.go b/src/pkg/expvar/expvar_test.go
index bbd9dd8..572c62b 100644
--- a/src/pkg/expvar/expvar_test.go
+++ b/src/pkg/expvar/expvar_test.go
@@ -18,6 +18,7 @@
}
func TestInt(t *testing.T) {
+ RemoveAll()
reqs := NewInt("requests")
if reqs.i != 0 {
t.Errorf("reqs.i = %v, want 0", reqs.i)
@@ -43,6 +44,7 @@
}
func TestFloat(t *testing.T) {
+ RemoveAll()
reqs := NewFloat("requests-float")
if reqs.f != 0.0 {
t.Errorf("reqs.f = %v, want 0", reqs.f)
@@ -68,6 +70,7 @@
}
func TestString(t *testing.T) {
+ RemoveAll()
name := NewString("my-name")
if name.s != "" {
t.Errorf("name.s = %q, want \"\"", name.s)
@@ -84,6 +87,7 @@
}
func TestMapCounter(t *testing.T) {
+ RemoveAll()
colors := NewMap("bike-shed-colors")
colors.Add("red", 1)
@@ -123,6 +127,7 @@
}
func TestFunc(t *testing.T) {
+ RemoveAll()
var x interface{} = []string{"a", "b"}
f := Func(func() interface{} { return x })
if s, exp := f.String(), `["a","b"]`; s != exp {