From 8e270f9201822605ab1424254920547121dd8eb0 Mon Sep 17 00:00:00 2001 From: Seebs Date: Thu, 15 Nov 2018 14:58:07 -0600 Subject: [PATCH] provide commented-out test case for bug in dead code bitmapEquals isn't currently being called ever, but it has an arcane edge-case bug, so I've made the test case for it and commented it out for future reference. --- roaring/roaring_internal_test.go | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/roaring/roaring_internal_test.go b/roaring/roaring_internal_test.go index a4c162629..266bf39e7 100644 --- a/roaring/roaring_internal_test.go +++ b/roaring/roaring_internal_test.go @@ -3261,3 +3261,26 @@ func TestUnmarshalOfficialRoaring(t *testing.T) { } } + +/* +// This function exercises an arcane edge case in dead code. +// It doesn't need to be run right now. +func TestEquals(t *testing.T) { + bma := NewBitmap() + bmr := NewBitmap() + for i := uint64(0); i < 30; i++ { + bma.Add(i) + bmr.Add(i) + } + bmr.Optimize() + bmi := bma.Intersect(bmr) + err := bitmapsEqual(bmi, bma) + if err != nil { + t.Fatalf("expected intersection to equal array") + } + err = bitmapsEqual(bmi, bmr) + if err != nil { + t.Fatalf("expected intersection to equal run") + } +} +*/