(ctx context.Context, t *testing.T, cs content.Store, ref string)
| 351 | } |
| 352 | |
| 353 | func checkRefNotAvailable(ctx context.Context, t *testing.T, cs content.Store, ref string) { |
| 354 | t.Helper() |
| 355 | |
| 356 | w, err := cs.Writer(ctx, content.WithRef(ref)) |
| 357 | if err == nil { |
| 358 | defer w.Close() |
| 359 | t.Fatal("writer created with ref, expected to be in use") |
| 360 | } |
| 361 | if !errdefs.IsUnavailable(err) { |
| 362 | t.Fatalf("Expected unavailable error, got %+v", err) |
| 363 | } |
| 364 | } |
| 365 | |
| 366 | func discardWriter(t *testing.T, w content.Writer) { |
| 367 | if err := w.Truncate(0); err != nil { |
no test coverage detected
searching dependent graphs…