(t *testing.T)
| 269 | } |
| 270 | |
| 271 | func TestWithTimeShouldOverrideTime(t *testing.T) { |
| 272 | now := time.Now().Add(24 * time.Hour) |
| 273 | |
| 274 | LogAndAssertJSON(t, func(log *Logger) { |
| 275 | log.WithTime(now).Info("foobar") |
| 276 | }, func(fields Fields) { |
| 277 | assert.Equal(t, fields["time"], now.Format(time.RFC3339)) |
| 278 | }) |
| 279 | } |
| 280 | |
| 281 | func TestWithTimeShouldNotOverrideFields(t *testing.T) { |
| 282 | now := time.Now().Add(24 * time.Hour) |
nothing calls this directly
no test coverage detected