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

Function TestWithClock

clock_test.go:39–47  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

37}
38
39func TestWithClock(t *testing.T) {
40 date := time.Date(2077, 1, 23, 10, 15, 13, 441, time.UTC)
41 clock := constantClock(date)
42 withLogger(t, DebugLevel, []Option{WithClock(clock)}, func(log *Logger, logs *observer.ObservedLogs) {
43 log.Info("")
44 require.Equal(t, 1, logs.Len(), "Expected only one log entry to be written.")
45 assert.Equal(t, date, logs.All()[0].Time, "Unexpected entry time.")
46 })
47}

Callers

nothing calls this directly

Calls 6

constantClockTypeAlias · 0.85
WithClockFunction · 0.85
AllMethod · 0.80
withLoggerFunction · 0.70
InfoMethod · 0.45
LenMethod · 0.45

Tested by

no test coverage detected