MCPcopy
hub / github.com/perkeep/perkeep / TestMultiStreamer

Function TestMultiStreamer

pkg/blobserver/multistream_test.go:69–86  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

67}
68
69func TestMultiStreamer(t *testing.T) {
70 var streamers []blobserver.BlobStreamer
71 var want []blob.SizedRef
72 n := 0
73
74 for st := 0; st < 3; st++ {
75 var blobs []*blob.Blob
76 for i := 0; i < 3; i++ {
77 n++
78 tb := &test.Blob{Contents: strconv.Itoa(n)}
79 b := tb.Blob()
80 want = append(want, b.SizedRef()) // overall
81 blobs = append(blobs, b) // this sub-streamer
82 }
83 streamers = append(streamers, staticStreamer(blobs))
84 }
85 storagetest.TestStreamer(t, blobserver.NewMultiBlobStreamer(streamers...), storagetest.WantSizedRefs(want))
86}

Callers

nothing calls this directly

Calls 6

BlobMethod · 0.95
TestStreamerFunction · 0.92
NewMultiBlobStreamerFunction · 0.92
WantSizedRefsTypeAlias · 0.92
staticStreamerTypeAlias · 0.85
SizedRefMethod · 0.45

Tested by

no test coverage detected