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

Function TestIOCoreWriteFailure

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

Source from the content-addressed store, hash-verified

155}
156
157func TestIOCoreWriteFailure(t *testing.T) {
158 core := NewCore(
159 NewJSONEncoder(testEncoderConfig()),
160 Lock(&ztest.FailWriter{}),
161 DebugLevel,
162 )
163 err := core.Write(Entry{}, nil)
164 // Should log the error.
165 assert.Error(t, err, "Expected writing Entry to fail.")
166}

Callers

nothing calls this directly

Calls 6

WriteMethod · 0.95
NewCoreFunction · 0.85
NewJSONEncoderFunction · 0.85
testEncoderConfigFunction · 0.85
LockFunction · 0.85
ErrorMethod · 0.45

Tested by

no test coverage detected