From 3859f9ad2916f701939fa7f1d0bc673cd55c1e33 Mon Sep 17 00:00:00 2001 From: Sergey Grebenshchikov Date: Fri, 20 Sep 2024 00:01:48 +0200 Subject: [PATCH] heap tests --- heap/heap_test.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/heap/heap_test.go b/heap/heap_test.go index fb669d6..93199be 100644 --- a/heap/heap_test.go +++ b/heap/heap_test.go @@ -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()) }