We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent fcaff5a commit f203b4cCopy full SHA for f203b4c
augmentedtree/atree_test.go
@@ -622,3 +622,20 @@ func TestInsertDuplicateIntervalChildren(t *testing.T) {
622
result := tree.Query(constructSingleDimensionInterval(0, 10, 0))
623
assert.Contains(t, result, iv1)
624
}
625
+
626
+func TestTraverse(t *testing.T) {
627
+ tree := newTree(1)
628
+ top := 30
629
+ for i := 0; i <= top; i++ {
630
+ tree.Add(constructSingleDimensionInterval(int64(i*10), int64((i+1)*10), uint64(i)))
631
+ }
632
+ found := map[uint64]bool{}
633
+ tree.Traverse(func(id Interval) {
634
+ found[id.ID()] = true
635
+ })
636
637
+ if found, _ := found[uint64(i)]; !found {
638
+ t.Errorf("could not find expected interval %d", i)
639
640
641
+}
0 commit comments