MCPcopy
hub / github.com/kopia/kopia / TestWriterFailure_OnCompression

Function TestWriterFailure_OnCompression

repo/object/object_manager_test.go:1036–1048  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

1034}
1035
1036func TestWriterFailure_OnCompression(t *testing.T) {
1037 _, _, om := setupTest(t, nil)
1038
1039 compression.RegisterCompressor("faulty", &faultyCompressor{})
1040
1041 ctx := testlogging.Context(t)
1042 w := om.NewWriter(ctx, WriterOptions{
1043 Compressor: "faulty",
1044 })
1045
1046 _, err := w.Write(bytes.Repeat([]byte{1, 2, 3, 4}, 1e6))
1047 require.ErrorIs(t, err, errSomeError)
1048}

Callers

nothing calls this directly

Calls 6

RegisterCompressorFunction · 0.92
ContextFunction · 0.92
setupTestFunction · 0.85
RepeatMethod · 0.80
NewWriterMethod · 0.65
WriteMethod · 0.45

Tested by

no test coverage detected