removed sparkline

This commit is contained in:
sm
2016-02-25 22:54:18 -08:00
parent 89425716d1
commit c5e9dcd2c6
2 changed files with 0 additions and 119 deletions
-65
View File
@@ -93,68 +93,3 @@ func TestHumanBytes(t *testing.T) {
t.Fatalf("did not get right human rate; got %v, want %v", got, want)
}
}
// TestSparkBadBucketCounts just makes sure that bad inputs are reported
func TestSparkBadBucketCounts(t *testing.T) {
bw := BPS{
buckets: make([]int64, 10),
}
sizes := []int{-10, -1, 0, 11, 12, 100, 1000}
for _, size := range sizes {
got := bw.Sparkline(size)
want := "bucket count inappropriate"
if got != want {
t.Fatalf("got: %v, want: %v", got, want)
}
}
}
// TestSparkline just creates a simple BPS and traverses all reasonable count
// sizes. It's primarily a test for panics which plagued us early on.
func TestSparkline(t *testing.T) {
buckets := 20
bw := BPS{
buckets: make([]int64, buckets),
}
t.Logf("all 0")
for i := 0; i < buckets; i++ {
bw.buckets[i] = 0
}
for i := 1; i < buckets; i++ {
line := bw.Sparkline(i)
t.Logf("count: %d, len %d: %+v", i, len([]rune(line)), line)
}
t.Logf("increasing")
for i := 0; i < buckets; i++ {
bw.buckets[i] = int64(i * buckets)
}
for i := 1; i < buckets; i++ {
line := bw.Sparkline(i)
t.Logf("count: %d, len %d: %+v", i, len([]rune(line)), line)
}
t.Logf("decreasing")
for i := 0; i < buckets; i++ {
bw.buckets[i] = int64((buckets - i) * buckets)
}
for i := 1; i < buckets; i++ {
line := bw.Sparkline(i)
t.Logf("count: %d, len %d: %+v", i, len([]rune(line)), line)
}
}
func TestSparkRandom(t *testing.T) {
buckets := 20
bw := BPS{
buckets: make([]int64, buckets),
}
bw.buckets[3] = 100
t.Logf("%+v", bw.Sparkline(10))
bw.buckets[7] = 300
for i := 1; i < buckets; i++ {
line := bw.Sparkline(i)
t.Logf("count: %d, len: %d: %+v", i, len([]rune(line)), line)
}
}