Permalink
Browse files

Tests for the stats package

  • Loading branch information...
jeffjenkins committed Nov 24, 2015
1 parent fa34257 commit a25011f2a5b788b60bae421f7ffb057731dd20a0
Showing with 21 additions and 0 deletions.
  1. +21 −0 stats/stats_test.go
View
@@ -0,0 +1,21 @@
package stats
import (
"github.com/rcrowley/go-metrics"
"testing"
)
func TestStats(t *testing.T) {
// This is basically for code coverage. These are simple wrappers.
// I'll add more tests once this start needing to do more.
var m = MakeHistogram("hello")
if m != metrics.Get("hello") {
t.Errorf("Got different histogram from MakeHistogram")
}
var start = Start()
RecordHisto(m, start-20)
if m.Max() < 19 || m.Max() > start {
t.Errorf("Bad value in histo %d", m.Max())
}
}

0 comments on commit a25011f

Please sign in to comment.