diff options
author | ian <ian@138bc75d-0d04-0410-961f-82ee72b054a4> | 2011-09-16 15:47:21 +0000 |
---|---|---|
committer | ian <ian@138bc75d-0d04-0410-961f-82ee72b054a4> | 2011-09-16 15:47:21 +0000 |
commit | 49b4e44b7d540fa846d353b10237848a67789cbf (patch) | |
tree | ea2b52e3c258d6b6d9356977c683c7f72a4a5fd5 /libgo/go/expvar | |
parent | 82ceb8f6a88a0193971f53e0571e017f2764f7d7 (diff) | |
download | gcc-49b4e44b7d540fa846d353b10237848a67789cbf.tar.gz |
Update Go library to r60.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@178910 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libgo/go/expvar')
-rw-r--r-- | libgo/go/expvar/expvar.go | 1 | ||||
-rw-r--r-- | libgo/go/expvar/expvar_test.go | 30 |
2 files changed, 15 insertions, 16 deletions
diff --git a/libgo/go/expvar/expvar.go b/libgo/go/expvar/expvar.go index 7123d4b0f77..7b733faf674 100644 --- a/libgo/go/expvar/expvar.go +++ b/libgo/go/expvar/expvar.go @@ -189,7 +189,6 @@ func (f Func) String() string { return string(v) } - // All published variables. var vars map[string]Var = make(map[string]Var) var mutex sync.Mutex diff --git a/libgo/go/expvar/expvar_test.go b/libgo/go/expvar/expvar_test.go index 94926d9f8ce..8f7a48168ea 100644 --- a/libgo/go/expvar/expvar_test.go +++ b/libgo/go/expvar/expvar_test.go @@ -76,33 +76,33 @@ func TestString(t *testing.T) { } func TestMapCounter(t *testing.T) { - colours := NewMap("bike-shed-colours") + colors := NewMap("bike-shed-colors") - colours.Add("red", 1) - colours.Add("red", 2) - colours.Add("blue", 4) - colours.AddFloat("green", 4.125) - if x := colours.m["red"].(*Int).i; x != 3 { - t.Errorf("colours.m[\"red\"] = %v, want 3", x) + colors.Add("red", 1) + colors.Add("red", 2) + colors.Add("blue", 4) + colors.AddFloat("green", 4.125) + if x := colors.m["red"].(*Int).i; x != 3 { + t.Errorf("colors.m[\"red\"] = %v, want 3", x) } - if x := colours.m["blue"].(*Int).i; x != 4 { - t.Errorf("colours.m[\"blue\"] = %v, want 4", x) + if x := colors.m["blue"].(*Int).i; x != 4 { + t.Errorf("colors.m[\"blue\"] = %v, want 4", x) } - if x := colours.m["green"].(*Float).f; x != 4.125 { - t.Errorf("colours.m[\"green\"] = %v, want 3.14", x) + if x := colors.m["green"].(*Float).f; x != 4.125 { + t.Errorf("colors.m[\"green\"] = %v, want 3.14", x) } - // colours.String() should be '{"red":3, "blue":4}', + // colors.String() should be '{"red":3, "blue":4}', // though the order of red and blue could vary. - s := colours.String() + s := colors.String() var j interface{} err := json.Unmarshal([]byte(s), &j) if err != nil { - t.Errorf("colours.String() isn't valid JSON: %v", err) + t.Errorf("colors.String() isn't valid JSON: %v", err) } m, ok := j.(map[string]interface{}) if !ok { - t.Error("colours.String() didn't produce a map.") + t.Error("colors.String() didn't produce a map.") } red := m["red"] x, ok := red.(float64) |