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

Function TestTestingWriter

zaptest/logger_test.go:107–114  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

105}
106
107func TestTestingWriter(t *testing.T) {
108 ts := newTestLogSpy(t)
109 w := NewTestingWriter(ts)
110
111 n, err := io.WriteString(w, "hello\n\n")
112 assert.NoError(t, err, "WriteString must not fail")
113 assert.Equal(t, 7, n)
114}
115
116func TestTestLoggerErrorOutput(t *testing.T) {
117 // This test verifies that the test logger logs internal messages to the

Callers

nothing calls this directly

Calls 3

newTestLogSpyFunction · 0.85
NewTestingWriterFunction · 0.85
WriteStringMethod · 0.80

Tested by

no test coverage detected