diff --git a/logging/mock.go b/logging/mock.go index b64f63a..66e046e 100644 --- a/logging/mock.go +++ b/logging/mock.go @@ -57,12 +57,12 @@ func (m writerMap) CheckWrittenAtLevel(t *testing.T, lv LogLevel, exp string) { } else { w = m[lv] } - if len(w.written) < 32 { + // 32 bytes covers the date, time and filename up to the colon in + // 2011/10/22 10:22:57 log_test.go:: + if len(w.written) <= 32 { t.Errorf("Not enough bytes logged at level %s:", LogString(lv)) t.Errorf("\tgot: %s", string(w.written)) } - // 32 bytes covers the date, time and filename up to the colon in - // 2011/10/22 10:22:57 log_test.go:: s := string(w.written[32:]) // 2 covers the : itself and the extra space idx := strings.Index(s, ":") + 2