MCPcopy
hub / github.com/segmentio/ksuid / testCompressedSetSingle

Function testCompressedSetSingle

set_test.go:214–238  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

212}
213
214func testCompressedSetSingle(t *testing.T) {
215 id := New()
216
217 set := Compress(
218 id, id, id, id, id, id, id, id, id, id,
219 id, id, id, id, id, id, id, id, id, id,
220 id, id, id, id, id, id, id, id, id, id,
221 id, id, id, id, id, id, id, id, id, id,
222 )
223
224 n := 0
225
226 for it := set.Iter(); it.Next(); {
227 if n != 0 {
228 t.Errorf("too many ids found in the compressed set: %s", it.KSUID)
229 } else if id != it.KSUID {
230 t.Errorf("invalid id found in the compressed set: %s != %s", it.KSUID, id)
231 }
232 n++
233 }
234
235 if n == 0 {
236 t.Error("no ids were produced by the compressed set")
237 }
238}
239
240func testCompressedSetSequence(t *testing.T) {
241 seq := Sequence{Seed: New()}

Callers

nothing calls this directly

Calls 4

NewFunction · 0.85
CompressFunction · 0.85
IterMethod · 0.80
NextMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…