message: Add brief blosc/lzf dataset filter tests
diff: @@ -1045,6 +1045,44 @@ impl<'d, T2: H5Type, D2: ndarray::Dimension> DatasetBuilderData<'d, T2, D2> {
  impl_builder_methods!();
  }
  +#[cfg(test)]
  +mod tests {
  + use super::{compute_chunk_shape, DatasetBuilder};
  + use crate::filters::Filter;
  + use crate::test::with_tmp_file;
  + use crate::{Extent, Result, SimpleExtents};
  +
  + #[cfg(feature = "blosc")]
  + use crate::filters::{Blosc, BloscShuffle};
  +
  + use ndarray::Array2;
  +
  + #[allow(dead_code)]
  + fn check_filter(func: impl Fn(DatasetBuilder) -> DatasetBuilder, flt: Filter) {
  + let filters = vec![flt];
  + with_tmp_file::<Result<_>, _>(|file| {
  + let arr = Array2::<i64>::ones((1000, 20));
  + func(file.new_dataset_builder()).with_data(&arr).create("foo")?;
  + let ds = file.dataset("foo")?;
  + assert_eq!(ds.filters(), filters);
  + assert_eq!(ds.read_2d::<i64>()?, &arr);
  + Ok(())
  + })
  + .unwrap()
  + }
  +
  + #[test]
  + #[cfg(feature = "blosc")]
  + fn test_blosc() {
  + check_filter(|d| d.blosc_zstd(9, true), Filter::Blosc(Blosc::ZStd, 9, BloscShuffle::Byte));
  + }
  +
  + #[test]
  + #[cfg(feature = "lzf")]
  + fn test_lzf() {
  + check_filter(|d| d.lzf(), Filter::LZF);
  + }
  +
  #[test]
  fn test_compute_chunk_shape() {
  let e = SimpleExtents::new(&[1, 1]);
  @@ -1074,3 +1112,4 @@ fn test_compute_chunk_shape() {
  let e = SimpleExtents::new(&[1, 1, 100]);
  assert_eq!(compute_chunk_shape(&e, 51), vec![1, 1, 100]);
  }
  +}
  