test ToRows

This commit is contained in:
Todd Gruben 2021-11-02 12:14:57 -05:00
parent f8d4d83e1a
commit a79bb893af
2 changed files with 39 additions and 2 deletions

View file

@ -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 ")
}
}

View file

@ -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()