meter_test.go 322 B

123456789101112131415161718
  1. package metrics
  2. import "testing"
  3. func TestMeterZero(t *testing.T) {
  4. m := NewMeter()
  5. if count := m.Count(); 0 != count {
  6. t.Errorf("m.Count(): 0 != %v\n", count)
  7. }
  8. }
  9. func TestMeterNonzero(t *testing.T) {
  10. m := NewMeter()
  11. m.Mark(3)
  12. if count := m.Count(); 3 != count {
  13. t.Errorf("m.Count(): 3 != %v\n", count)
  14. }
  15. }