(t *testing.T)
| 30 | } |
| 31 | |
| 32 | func (lt *lmdbTest) run(t *testing.T) { |
| 33 | srcBlobs := make(chan blob.SizedRef, 100) |
| 34 | destBlobs := make(chan blob.SizedRef, 100) |
| 35 | sendTestBlobs(srcBlobs, lt.src, 123) |
| 36 | destSize := uint32(123) |
| 37 | if lt.diffSize { |
| 38 | destSize = 567 |
| 39 | } |
| 40 | sendTestBlobs(destBlobs, lt.dst, destSize) |
| 41 | |
| 42 | missingc := make(chan blob.SizedRef) |
| 43 | var missing, mismatch []string |
| 44 | onMismatch := func(br blob.Ref) { |
| 45 | mismatch = append(mismatch, br.String()) |
| 46 | } |
| 47 | go ListMissingDestinationBlobs(missingc, onMismatch, srcBlobs, destBlobs) |
| 48 | for sb := range missingc { |
| 49 | missing = append(missing, sb.Ref.String()) |
| 50 | } |
| 51 | if got := strings.Join(missing, ","); got != lt.missing { |
| 52 | t.Errorf("For src %q and dest %q got missing %q; want %q", |
| 53 | lt.src, lt.dst, got, lt.missing) |
| 54 | } |
| 55 | if got := strings.Join(mismatch, ","); got != lt.mismatch { |
| 56 | t.Errorf("For src %q and dest %q got mismatched %q; want %q", |
| 57 | lt.src, lt.dst, got, lt.mismatch) |
| 58 | } |
| 59 | } |
| 60 | |
| 61 | func sendTestBlobs(ch chan blob.SizedRef, list string, size uint32) { |
| 62 | defer close(ch) |
no test coverage detected