(t *testing.T)
| 1043 | } |
| 1044 | |
| 1045 | func 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 | |
| 1055 | func infoLog(logger *Logger, msg string, fields ...Field) { |
| 1056 | logger.Info(msg, fields...) |