~ubuntu-branches/ubuntu/saucy/golang/saucy

« back to all changes in this revision

Viewing changes to src/pkg/expvar/expvar_test.go

  • Committer: Package Import Robot
  • Author(s): Adam Conrad
  • Date: 2013-07-08 05:52:37 UTC
  • mfrom: (29.1.1 sid)
  • Revision ID: package-import@ubuntu.com-20130708055237-at01839e0hp8z3ni
Tags: 2:1.1-1ubuntu1
016-armhf-elf-header.patch: Use correct ELF header for armhf binaries.

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
}
19
19
 
20
20
func TestInt(t *testing.T) {
 
21
        RemoveAll()
21
22
        reqs := NewInt("requests")
22
23
        if reqs.i != 0 {
23
24
                t.Errorf("reqs.i = %v, want 0", reqs.i)
43
44
}
44
45
 
45
46
func TestFloat(t *testing.T) {
 
47
        RemoveAll()
46
48
        reqs := NewFloat("requests-float")
47
49
        if reqs.f != 0.0 {
48
50
                t.Errorf("reqs.f = %v, want 0", reqs.f)
68
70
}
69
71
 
70
72
func TestString(t *testing.T) {
 
73
        RemoveAll()
71
74
        name := NewString("my-name")
72
75
        if name.s != "" {
73
76
                t.Errorf("name.s = %q, want \"\"", name.s)
84
87
}
85
88
 
86
89
func TestMapCounter(t *testing.T) {
 
90
        RemoveAll()
87
91
        colors := NewMap("bike-shed-colors")
88
92
 
89
93
        colors.Add("red", 1)
123
127
}
124
128
 
125
129
func TestFunc(t *testing.T) {
 
130
        RemoveAll()
126
131
        var x interface{} = []string{"a", "b"}
127
132
        f := Func(func() interface{} { return x })
128
133
        if s, exp := f.String(), `["a","b"]`; s != exp {