Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
wcharczuk committed Jul 15, 2024
1 parent 0e3c56e commit 88511ca
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions recompute_heap_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -411,6 +411,10 @@ func Test_recomputeHeap_clear(t *testing.T) {
rh.add(n60)
rh.add(n70)

testutil.NotEqual(t, HeightUnset, n50.n.heightInRecomputeHeap)
testutil.NotEqual(t, HeightUnset, n60.n.heightInRecomputeHeap)
testutil.NotEqual(t, HeightUnset, n70.n.heightInRecomputeHeap)

testutil.Equal(t, 3, rh.numItems)
testutil.Equal(t, 1, rh.heights[5].len())
testutil.Equal(t, 1, rh.heights[6].len())
Expand All @@ -420,6 +424,10 @@ func Test_recomputeHeap_clear(t *testing.T) {

rh.clear()

testutil.Equal(t, HeightUnset, n50.n.heightInRecomputeHeap)
testutil.Equal(t, HeightUnset, n60.n.heightInRecomputeHeap)
testutil.Equal(t, HeightUnset, n70.n.heightInRecomputeHeap)

testutil.Equal(t, 0, rh.numItems)
testutil.Equal(t, 0, rh.heights[5].len())
testutil.Equal(t, 0, rh.heights[6].len())
Expand All @@ -431,6 +439,10 @@ func Test_recomputeHeap_clear(t *testing.T) {
rh.add(n60)
rh.add(n70)

testutil.NotEqual(t, HeightUnset, n50.n.heightInRecomputeHeap)
testutil.NotEqual(t, HeightUnset, n60.n.heightInRecomputeHeap)
testutil.NotEqual(t, HeightUnset, n70.n.heightInRecomputeHeap)

testutil.Equal(t, 3, rh.numItems)
testutil.Equal(t, 1, rh.heights[5].len())
testutil.Equal(t, 1, rh.heights[6].len())
Expand Down

0 comments on commit 88511ca

Please sign in to comment.