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

Function TestTeeSync

zapcore/tee_test.go:175–192  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

173}
174
175func TestTeeSync(t *testing.T) {
176 infoLogger, _ := observer.New(InfoLevel)
177 warnLogger, _ := observer.New(WarnLevel)
178 tee := NewTee(infoLogger, warnLogger)
179 assert.NoError(t, tee.Sync(), "Unexpected error from Syncing a tee.")
180
181 sink := &ztest.Discarder{}
182 err := errors.New("failed")
183 sink.SetError(err)
184
185 noSync := NewCore(
186 NewJSONEncoder(testEncoderConfig()),
187 sink,
188 DebugLevel,
189 )
190 tee = NewTee(tee, noSync)
191 assert.Equal(t, err, tee.Sync(), "Expected an error when part of tee can't Sync.")
192}

Callers

nothing calls this directly

Calls 7

NewFunction · 0.92
NewTeeFunction · 0.85
NewCoreFunction · 0.85
NewJSONEncoderFunction · 0.85
testEncoderConfigFunction · 0.85
SetErrorMethod · 0.80
SyncMethod · 0.65

Tested by

no test coverage detected