MCPcopy
hub / github.com/google/mangle / TestIntervalTree_All

Function TestIntervalTree_All

factstore/interval_tree_test.go:157–179  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

155}
156
157func TestIntervalTree_All(t *testing.T) {
158 tree := NewIntervalTree()
159
160 intervals := []ast.Interval{
161 makeTestInterval(100, 200),
162 makeTestInterval(50, 75),
163 makeTestInterval(150, 250),
164 }
165
166 for _, i := range intervals {
167 tree.Insert(i)
168 }
169
170 count := 0
171 tree.All(func(interval ast.Interval) error {
172 count++
173 return nil
174 })
175
176 if count != len(intervals) {
177 t.Errorf("All() returned %d intervals, want %d", count, len(intervals))
178 }
179}
180
181func TestIntervalTree_Clear(t *testing.T) {
182 tree := NewIntervalTree()

Callers

nothing calls this directly

Calls 4

InsertMethod · 0.95
AllMethod · 0.95
NewIntervalTreeFunction · 0.85
makeTestIntervalFunction · 0.85

Tested by

no test coverage detected