Skip to content

Commit

Permalink
heap tests
Browse files Browse the repository at this point in the history
  • Loading branch information
sgreben committed Sep 19, 2024
1 parent 0dc5a0f commit 3859f9a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions heap/heap_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -161,19 +161,19 @@ func TestMinHeap_SizeBytes(t *testing.T) {
}

h.Update("a", 1, 5)
expectedSize += len("a") + sizeof.String + sizeof.Int // Size of new item in heap
expectedSize += len("a") + sizeof.String + sizeof.UInt32*2 // Size of new item in heap
if h.SizeBytes() != expectedSize {
t.Errorf("expected SizeBytes to be %d, got %d", expectedSize, h.SizeBytes())
}

h.Update("b", 2, 10)
expectedSize += len("b") + sizeof.String + sizeof.Int
expectedSize += len("b") + sizeof.String + sizeof.UInt32*2
if h.SizeBytes() != expectedSize {
t.Errorf("expected SizeBytes to be %d, got %d", expectedSize, h.SizeBytes())
}

h.Update("long_string_item", 3, 15)
expectedSize += len("long_string_item") + sizeof.String + sizeof.Int
expectedSize += len("long_string_item") + sizeof.String + sizeof.UInt32*2
if h.SizeBytes() != expectedSize {
t.Errorf("expected SizeBytes to be %d, got %d", expectedSize, h.SizeBytes())
}
Expand Down

0 comments on commit 3859f9a

Please sign in to comment.