Skip to content

Commit 0c91603

Browse files
Test: traverse an empty tree
1 parent 7d33211 commit 0c91603

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

augmentedtree/atree_test.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -625,6 +625,11 @@ func TestInsertDuplicateIntervalChildren(t *testing.T) {
625625

626626
func TestTraverse(t *testing.T) {
627627
tree := newTree(1)
628+
629+
tree.Traverse(func(i Interval) {
630+
assert.Fail(t, `traverse should not be called for empty tree`)
631+
})
632+
628633
top := 30
629634
for i := 0; i <= top; i++ {
630635
tree.Add(constructSingleDimensionInterval(int64(i*10), int64((i+1)*10), uint64(i)))

0 commit comments

Comments
 (0)