mirror of
https://github.com/featurebasedb/featurebase.git
synced 2026-09-12 15:51:01 +00:00
Added the actual bytes and their respective errors
This commit is contained in:
parent
a1f6321b1d
commit
0a87d8108f
1 changed files with 13 additions and 5 deletions
|
|
@ -8,16 +8,24 @@ func TestUnmarshalBinary(t *testing.T) {
|
|||
b := NewBitmap()
|
||||
confirmedCrashers := []struct {
|
||||
cr []byte
|
||||
expected string
|
||||
} {
|
||||
{cr : []byte(":000000")},
|
||||
{cr : []byte("<000000000000000")},
|
||||
{
|
||||
cr : []byte(":0\x000\x01\x00\x00\x000000"), //":000000"
|
||||
expected : "reading roaring header: malformed bitmap, key-cardinality slice overruns buffer at 12",
|
||||
},
|
||||
{
|
||||
cr : []byte("<0\x000\x00\x00\x00\x00000000000000" +
|
||||
"0"), //"<000000000000000"
|
||||
expected : "unmarshaling as pilosa roaring: too big",
|
||||
},
|
||||
}
|
||||
|
||||
for _, crash := range confirmedCrashers {
|
||||
err := b.UnmarshalBinary(crash.cr)
|
||||
if err != nil {
|
||||
t.Error("Known crasher failed.")
|
||||
}
|
||||
if err.Error() != crash.expected {
|
||||
t.Errorf("Expected: %s, Got: %s", crash.expected, err)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Loading…
Add table
Reference in a new issue