(t *testing.T)
| 111 | } |
| 112 | |
| 113 | func testCompressedSetPacked(t *testing.T) { |
| 114 | sequences := [10]Sequence{} |
| 115 | for i := range sequences { |
| 116 | sequences[i] = Sequence{Seed: New()} |
| 117 | } |
| 118 | |
| 119 | ksuids := [1000]KSUID{} |
| 120 | for i := range ksuids { |
| 121 | ksuids[i], _ = sequences[i%len(sequences)].Next() |
| 122 | } |
| 123 | |
| 124 | set := Compress(ksuids[:]...) |
| 125 | |
| 126 | for i, it := 0, set.Iter(); it.Next(); { |
| 127 | if i >= len(ksuids) { |
| 128 | t.Error("too many KSUIDs were produced by the set iterator") |
| 129 | break |
| 130 | } |
| 131 | if ksuids[i] != it.KSUID { |
| 132 | t.Errorf("bad KSUID at index %d: expected %s but found %s", i, ksuids[i], it.KSUID) |
| 133 | } |
| 134 | i++ |
| 135 | } |
| 136 | |
| 137 | reportCompressionRatio(t, ksuids[:], set) |
| 138 | } |
| 139 | |
| 140 | func testCompressedSetMixed(t *testing.T) { |
| 141 | now := time.Now() |
nothing calls this directly
no test coverage detected
searching dependent graphs…