mirror of
https://github.com/featurebasedb/featurebase.git
synced 2026-09-07 09:05:55 +00:00
test ToRows
This commit is contained in:
parent
f8d4d83e1a
commit
a79bb893af
2 changed files with 39 additions and 2 deletions
|
|
@ -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 ")
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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()
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue