(t *testing.T)
| 90 | } |
| 91 | |
| 92 | func TestAddRandom(t *testing.T) { |
| 93 | var s Set |
| 94 | order := rand.Perm(testSize) |
| 95 | var nrInsertions int |
| 96 | for i, j := range order { |
| 97 | s.InsertWithoutMergingRange(Range{j, j + 1}, j+valueOffset) |
| 98 | nrInsertions++ |
| 99 | if err := s.segmentTestCheck(nrInsertions, validate); err != nil { |
| 100 | t.Errorf("Iteration %d: %v", i, err) |
| 101 | break |
| 102 | } |
| 103 | } |
| 104 | if got, want := s.countSegments(), nrInsertions; got != want { |
| 105 | t.Errorf("Wrong final number of segments: got %d, wanted %d", got, want) |
| 106 | } |
| 107 | if t.Failed() { |
| 108 | t.Logf("Insertion order: %v", order[:nrInsertions]) |
| 109 | t.Logf("Set contents:\n%v", &s) |
| 110 | } |
| 111 | } |
| 112 | |
| 113 | func TestRemoveRandom(t *testing.T) { |
| 114 | var s Set |
nothing calls this directly
no test coverage detected
searching dependent graphs…