meter_test.go 327 B

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