Add a simple test for the CboRoaringBitmapCodec

This commit is contained in:
Clément Renault 2020-10-02 16:52:36 +02:00
parent c4b0c57059
commit e41a3822a6
No known key found for this signature in database
GPG Key ID: 92ADA4E935E71FA4

View File

@ -67,3 +67,18 @@ impl heed::BytesEncode<'_> for CboRoaringBitmapCodec {
Some(Cow::Owned(vec))
}
}
#[cfg(test)]
mod tests {
use std::iter::FromIterator;
use heed::{BytesEncode, BytesDecode};
use super::*;
#[test]
fn limit_four() {
let input = RoaringBitmap::from_iter(vec![0, 1, 2, 3]);
let bytes = CboRoaringBitmapCodec::bytes_encode(&input).unwrap();
let output = CboRoaringBitmapCodec::bytes_decode(&bytes).unwrap();
assert_eq!(input, output);
}
}