use erased_cells::{BufferOps, CellBuffer, CellType, CellValue};
fn main() {
let buf1 = CellBuffer::fill_via(9, |i| i as u8);
assert_eq!(buf1.cell_type(), CellType::UInt8);
let val: CellValue = buf1.get(3);
assert_eq!(val, CellValue::UInt8(3));
let (min, max): (CellValue, CellValue) = buf1.min_max();
assert_eq!((min, max), (CellValue::UInt8(0), CellValue::UInt8(8)));
assert_eq!(((max - min + 1) / 2), 4.5.into());
let buf2 = CellBuffer::fill_via(9, |i| 8f32 - i as f32);
assert_eq!(buf2.cell_type(), CellType::Float32);
assert_eq!(
buf2.min_max(),
(CellValue::Float32(0.0), CellValue::Float32(8.0))
);
let diff = buf2 - buf1;
assert_eq!(diff.min_max(), ((-8).into(), 8.into()));
}