bitly / statsdaemon

an implementation of Etsy's statsd in Go
The Unlicense
570 stars 131 forks source link

Simplified tests #47

Closed JamesCohen-awin closed 9 years ago

JamesCohen-awin commented 9 years ago

I tidied up some of the tests:

JamesCohen-awin commented 9 years ago

also of note for whoever reviews this...

I removed the test from statsdaemon_test.go#L286 as the test string shouldn't appear in the output and wasn't being - even though the test was passing(!)

mreiferson commented 9 years ago

curious what go test -cover reports before/after this change? would you mind pasting?

JamesCohen-awin commented 9 years ago

coverage reduces a tiny bit

$ diff /tmp/cover-master.txt /tmp/cover-tidyup.txt 
13c13
< github.com/bitly/statsdaemon/statsdaemon.go:226:  processTimers   100.0%
---
> github.com/bitly/statsdaemon/statsdaemon.go:226:  processTimers   97.4%
17c17
< total:                            (statements)    56.2%
---
> total:                            (statements)    55.6%

It's the "continue" here that is no longer covered:

func processTimers(buffer *bytes.Buffer, now int64, pctls Percentiles) int64 {
        var num int64
        for u, t := range timers {
                if len(t) == 0 {
                        continue
                }
mreiferson commented 9 years ago

k, thanks again :grin: