108 for _, c := range cases {
109 if got := b.Index(c.t); got != c.want {
110▶ t.Errorf("Index(%s) = %d, want %d", c.t, got, c.want)
111 }
112 }
· · ·
117 b := NewBucketing(when, when, 8)
118 if got := b.Index(when); got != 0 {
119▶ t.Errorf("degenerate window: Index = %d, want 0", got)
120 }
121 if got := b.Index(when.Add(time.Hour)); got != 0 {
· · ·
122▶ t.Errorf("degenerate window: future Index = %d, want 0", got)
123 }
124}
· · ·
129 b := NewBucketing(from, to, 10)
130 if got := b.Start(0); !got.Equal(from) {
131▶ t.Errorf("Start(0) = %s, want %s", got, from)
132 }
133 if got := b.Start(5); !got.Equal(from.Add(5 * 24 * time.Hour)) {
· · ·
134▶ t.Errorf("Start(5) = %s, want %s", got, from.Add(5*24*time.Hour))
135 }
136}
+ 23 more matches in this file