(ctx context.Context, t *testing.T, r repo.Repository, oid object.ID, want []byte)
| 334 | } |
| 335 | |
| 336 | func mustReadObject(ctx context.Context, t *testing.T, r repo.Repository, oid object.ID, want []byte) { |
| 337 | t.Helper() |
| 338 | |
| 339 | or, err := r.OpenObject(ctx, oid) |
| 340 | require.NoError(t, err) |
| 341 | |
| 342 | data, err := io.ReadAll(or) |
| 343 | require.NoError(t, err) |
| 344 | |
| 345 | // verify data is read back the same. |
| 346 | if diff := cmp.Diff(data, want); diff != "" { |
| 347 | t.Fatalf("invalid object data, diff: %v", diff) |
| 348 | } |
| 349 | } |
| 350 | |
| 351 | func mustReadManifest(ctx context.Context, t *testing.T, r repo.Repository, manID manifest.ID, want string) { |
| 352 | t.Helper() |
no test coverage detected