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

Function TestIOCoreSyncFail

zapcore/core_test.go:111–128  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

109}
110
111func TestIOCoreSyncFail(t *testing.T) {
112 sink := &ztest.Discarder{}
113 err := errors.New("failed")
114 sink.SetError(err)
115
116 core := NewCore(
117 NewJSONEncoder(testEncoderConfig()),
118 sink,
119 DebugLevel,
120 )
121
122 assert.Equal(
123 t,
124 err,
125 core.Sync(),
126 "Expected core.Sync to return errors from underlying WriteSyncer.",
127 )
128}
129
130func TestIOCoreSyncsOutput(t *testing.T) {
131 tests := []struct {

Callers

nothing calls this directly

Calls 5

SyncMethod · 0.95
NewCoreFunction · 0.85
NewJSONEncoderFunction · 0.85
testEncoderConfigFunction · 0.85
SetErrorMethod · 0.80

Tested by

no test coverage detected