MCPcopy
hub / github.com/kopia/kopia / TestWriterCompleteChunkInTwoWrites

Function TestWriterCompleteChunkInTwoWrites

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

Source from the content-addressed store, hash-verified

283}
284
285func TestWriterCompleteChunkInTwoWrites(t *testing.T) {
286 ctx := testlogging.Context(t)
287 _, _, om := setupTest(t, nil)
288
289 b := make([]byte, 100)
290 writer := om.NewWriter(ctx, WriterOptions{})
291 writer.Write(b[0:50])
292 writer.Write(b[0:50])
293 result, err := writer.Result()
294
295 if !objectIDsEqual(result, mustParseID(t, "cd00e292c5970d3c5e2f0ffa5171e555bc46bfc4faddfb4a418b6840b86e79a3")) {
296 t.Errorf("unexpected result: %v err: %v", result, err)
297 }
298}
299
300func TestCheckpointing(t *testing.T) {
301 ctx := testlogging.Context(t)

Callers

nothing calls this directly

Calls 8

ResultMethod · 0.95
ContextFunction · 0.92
setupTestFunction · 0.85
ErrorfMethod · 0.80
objectIDsEqualFunction · 0.70
mustParseIDFunction · 0.70
NewWriterMethod · 0.65
WriteMethod · 0.45

Tested by

no test coverage detected