MCPcopy
hub / github.com/perkeep/perkeep / TestMergedEnumerate

Function TestMergedEnumerate

pkg/blobserver/mergedenum_test.go:105–130  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

103}
104
105func TestMergedEnumerate(t *testing.T) {
106 for _, tt := range mergedTests {
107 ctx := context.TODO()
108 var got []string
109 ch := make(chan blob.SizedRef)
110 errc := make(chan error)
111 limit := tt.limit
112 if limit == 0 {
113 limit = 1e9
114 }
115 go func() {
116 errc <- MergedEnumerate(ctx, ch, tt.srcs, tt.after, limit)
117 }()
118 for sb := range ch {
119 got = append(got, sb.Ref.String())
120 }
121 if err := <-errc; err != nil {
122 t.Errorf("%s. MergedEnumerate = %v", tt.name, err)
123 continue
124 }
125 if !reflect.DeepEqual(got, tt.want) {
126 t.Errorf("%s. different:\n got = %v\nwant = %v", tt.name, got, tt.want)
127 continue
128 }
129 }
130}
131
132func enumBlobs(v ...string) BlobEnumerator {
133 sort.Strings(v)

Callers

nothing calls this directly

Calls 2

MergedEnumerateFunction · 0.85
StringMethod · 0.45

Tested by

no test coverage detected