~ubuntu-branches/ubuntu/vivid/golang/vivid

« back to all changes in this revision

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

  • Committer: Package Import Robot
  • Author(s): James Page
  • Date: 2013-08-20 14:06:23 UTC
  • mfrom: (14.1.23 saucy-proposed)
  • Revision ID: package-import@ubuntu.com-20130820140623-b414jfxi3m0qkmrq
Tags: 2:1.1.2-2ubuntu1
* Merge from Debian unstable (LP: #1211749, #1202027). Remaining changes:
  - 016-armhf-elf-header.patch: Use correct ELF header for armhf binaries.
  - d/control,control.cross: Update Breaks/Replaces for Ubuntu
    versions to ensure smooth upgrades, regenerate control file.

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 {