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

Function TestMultiWriteSyncerFailsShortWrite

zapcore/write_syncer_test.go:97–102  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

95}
96
97func TestMultiWriteSyncerFailsShortWrite(t *testing.T) {
98 ws := NewMultiWriteSyncer(AddSync(&ztest.ShortWriter{}))
99 n, err := ws.Write([]byte("test"))
100 assert.NoError(t, err, "Expected fake-success from short write")
101 assert.Equal(t, 3, n, "Expected byte count to return from underlying writer")
102}
103
104func TestWritestoAllSyncs_EvenIfFirstErrors(t *testing.T) {
105 failer := &ztest.FailWriter{}

Callers

nothing calls this directly

Calls 3

NewMultiWriteSyncerFunction · 0.85
AddSyncFunction · 0.85
WriteMethod · 0.65

Tested by

no test coverage detected