333
// the test logger, the expectation either acts as an entry in a blocklist
334
// (FailOnExpectedErrorOnly) or an allowlist (FailOnAnyUnexpectedError).
335
>
func (tl *TestLogger) Expect(level Level, msg string, tags ...tag.Tag) *Expectation {
testlogger.go
336
>
tl.state.mu.Lock()
337
>
defer tl.state.mu.Unlock()
338
>
if tl.state.logExpectations {
339
tl.wrapped.Info(fmt.Sprintf("(%p) TestLogger::Expecting: '%s'\n", tl, msg))
340
}
342
>
testLogger: tl,
343
>
lvl: level,
344
>
}
345
>
m := newMatcher(msg, tags, e)
346
>
expectations, ok := tl.state.mu.expectations[level]
347
>
if !ok {
348
>
expectations = list.New()
349
>
tl.state.mu.expectations[level] = expectations
350
>
}
351
>
e.e = expectations.PushBack(m)
352
>
return e
353
}
354