MCPcopy
hub / github.com/uber-go/zap / TestMust

Function TestMust

logger_test.go:1045–1053  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

1043}
1044
1045func TestMust(t *testing.T) {
1046 t.Run("must without an error does not panic", func(t *testing.T) {
1047 assert.NotPanics(t, func() { Must(NewNop(), nil) }, "must paniced with no error")
1048 })
1049
1050 t.Run("must with an error panics", func(t *testing.T) {
1051 assert.Panics(t, func() { Must(nil, errors.New("an error")) }, "must did not panic with an error")
1052 })
1053}
1054
1055func infoLog(logger *Logger, msg string, fields ...Field) {
1056 logger.Info(msg, fields...)

Callers

nothing calls this directly

Calls 2

MustFunction · 0.85
NewNopFunction · 0.85

Tested by

no test coverage detected