(t *testing.T)
| 166 | } |
| 167 | |
| 168 | func TestMaxGapAddRandomWithRandomInterval(t *testing.T) { |
| 169 | var s gapSet |
| 170 | order := randIntervalPermutation(testSize) |
| 171 | var nrInsertions int |
| 172 | for i, j := range order { |
| 173 | s.InsertWithoutMergingRange(Range{j, j + rand.Intn(intervalLength-1) + 1}, j+valueOffset) |
| 174 | nrInsertions++ |
| 175 | if err := s.segmentTestCheck(nrInsertions, validate); err != nil { |
| 176 | t.Errorf("Iteration %d: %v", i, err) |
| 177 | break |
| 178 | } |
| 179 | if err := checkSetMaxGap(&s); err != nil { |
| 180 | t.Errorf("When inserting %d: %v", j, err) |
| 181 | break |
| 182 | } |
| 183 | } |
| 184 | if got, want := s.countSegments(), nrInsertions; got != want { |
| 185 | t.Errorf("Wrong final number of segments: got %d, wanted %d", got, want) |
| 186 | } |
| 187 | if t.Failed() { |
| 188 | t.Logf("Insertion order: %v", order[:nrInsertions]) |
| 189 | t.Logf("Set contents:\n%v", &s) |
| 190 | } |
| 191 | } |
| 192 | |
| 193 | func TestMaxGapAddRandomWithMerge(t *testing.T) { |
| 194 | var s gapSet |
nothing calls this directly
no test coverage detected
searching dependent graphs…