Maraiah/tests/pict.rs

24 lines
469 B
Rust
Raw Normal View History

use maraiah::image::{pict, Color8};
2019-03-04 20:57:25 -08:00
include!("data/rand.rs");
#[test]
fn get_clut_must_process()
{
2019-03-12 13:28:08 -07:00
const INPUT: &[u8] = include_bytes!("data/pict/clut.in");
const OUTPUT: [Color8; 256] = include!("data/pict/clut.out");
2019-03-04 20:57:25 -08:00
assert_eq!(pict::clut::read(INPUT).unwrap(), (OUTPUT.to_vec(), 2056));
2019-03-04 20:57:25 -08:00
}
#[test]
fn pict_must_not_process()
{
for inp in &RANDOM {
assert!(pict::clut::read(inp).is_err());
assert!(pict::read(inp).is_err());
2019-03-04 20:57:25 -08:00
}
}
// EOF