From a79bb893af3f8a795be9f7af356a814197916b7f Mon Sep 17 00:00:00 2001 From: Todd Gruben Date: Tue, 2 Nov 2021 12:14:57 -0500 Subject: [PATCH] test ToRows --- executor_test.go | 37 ++++++++++++++++++++++++++++++++ roaring/roaring_internal_test.go | 4 ++-- 2 files changed, 39 insertions(+), 2 deletions(-) diff --git a/executor_test.go b/executor_test.go index ba357d724..c42d7eb14 100644 --- a/executor_test.go +++ b/executor_test.go @@ -8184,3 +8184,40 @@ func TestExternalLookup(t *testing.T) { } }) } +func TestToRows(t *testing.T) { + ids := &pilosa.RowIdentifiers{ + Rows: []uint64{1, 2, 3}, + } + c := ids.Clone() + if c == nil { + t.Fatal("Shouldn't be nil ") + } + e := ids.ToRows(func(*proto.RowResponse) error { + return nil + }) + if e != nil { + t.Fatal("Shouldn't be err ", e) + } + + keys := &pilosa.RowIdentifiers{ + Keys: []string{"a", "b"}, + } + c = keys.Clone() + if c == nil { + t.Fatal("Shouldn't be nil ") + } + e = keys.ToRows(func(*proto.RowResponse) error { + return nil + }) + if e != nil { + t.Fatal("Shouldn't be err ", e) + } + v := &pilosa.ValCount{ + TimestampVal: time.Now(), + Count: 1, + } + x := v.Clone() + if x == nil { + t.Fatal("Shouldn't be nil ") + } +} diff --git a/roaring/roaring_internal_test.go b/roaring/roaring_internal_test.go index a5ff6f5f5..da65e2306 100644 --- a/roaring/roaring_internal_test.go +++ b/roaring/roaring_internal_test.go @@ -4818,8 +4818,8 @@ func TestVariousBitmap(t *testing.T) { if b.Max() == 0 { t.Fatal("should max >0") } - if m, e := b.Min(); !(m == 1 && e) { - t.Fatal("min should be 1 and containers exist") + if m, e := b.Min(); !(m == 3 && e) { + t.Fatal("min should be 3 and containers exist", m, e) } b = nil x := b.Clone()