From 9306290d964af604d8d3a3f819b2e529f90607be Mon Sep 17 00:00:00 2001 From: Todd Gruben Date: Tue, 26 Nov 2013 11:15:45 -0600 Subject: [PATCH] basic goconvey tests for bitmap --- index/bitmap_test.go | 132 ++++++++++++++++++++----------------------- 1 file changed, 62 insertions(+), 70 deletions(-) diff --git a/index/bitmap_test.go b/index/bitmap_test.go index 9b50e6067..470c9fd07 100644 --- a/index/bitmap_test.go +++ b/index/bitmap_test.go @@ -2,77 +2,69 @@ package index import ( "testing" + . "github.com/smartystreets/goconvey/convey" ) -func TestCount(t *testing.T) { - bm:= CreateRBBitmap() - for i:=uint64(0); i true ", t, func() { + bm1:= CreateRBBitmap() + bm2:= CreateRBBitmap() + SetBit(bm1,1) + //SetBit(bm2,2) + all:= AND_NOT(bm1,bm2) + res :=BitCount(all) - if bc1 != uint64(4096){ - t.Errorf("Count (%d) no equal 4096",bc1) + So(1, ShouldEqual, res) + }) +/* + SetBit(bm2,1) + all= AND_NOT(bm1,bm2) + res =BitCount(all) + if res != 0{ + t.Errorf("SHOULD BE 0 => %d",res) + } + */ + + //func TestUnion(t *testing.T) { + Convey("UNION even + odd equal 4096 ", t, func() { + even:= CreateRBBitmap() + for i:=uint64(0); i %d",res) - } - - SetBit(bm2,1) - all= AND_NOT(bm1,bm2) - res =BitCount(all) - if res != 0{ - t.Errorf("SHOULD BE 0 => %d",res) - } - -} -func TestUnion(t *testing.T) { - even:= CreateRBBitmap() - for i:=uint64(0); i