#![deny(missing_docs)]
mod decoder;
mod error;
pub mod types;
pub use error::Error;
pub use decoder::BmpDecoder;
pub type Result<T> = std::result::Result<T, error::Error>;
#[cfg(test)]
mod tests {
use super::*;
use tokio::{
fs::File,
stream::StreamExt,
};
use tokio_util::codec::FramedRead;
use std::ffi::OsStr;
use std::fs;
#[tokio::test]
async fn test_data() {
for entry in fs::read_dir("test_data/").unwrap() {
let entry = entry.unwrap();
match entry.path().extension() {
Some(ext) if ext == OsStr::new("dump") => {
println!("Testing {}", entry.path().display());
let fh = File::open(&entry.path()).await.unwrap();
let mut rdr = FramedRead::new(fh, BmpDecoder::new());
while let Some(msg) = rdr.next().await {
match msg {
Ok(_) => {},
Err(err) => panic!("Error: {}", err)
};
}
},
_ => {}
};
}
}
}