test: the v4 chunk-index selection test passes clippy -D warnings

A type alias for the hyperslab tuple, and as_chunks for the i32 decode.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
This commit is contained in:
osobh
2026-09-26 09:05:31 -05:00
co-authored by Claude Opus 5.5
parent 45d617c39e
commit 8dcce084ca
@@ -122,7 +122,10 @@ const CASES: &[Case] = &[
/// `(start, stride, count, block)` per dimension; the first few stay below
/// half the dataset (bounding-box path), the rest exceed it (full path).
fn selections() -> Vec<([u64; 2], [u64; 2], [u64; 2], [u64; 2])> {
/// `(start, stride, count, block)` of a 2-D hyperslab.
type Hyperslab2 = ([u64; 2], [u64; 2], [u64; 2], [u64; 2]);
fn selections() -> Vec<Hyperslab2> {
vec![
([0, 0], [1, 1], [3, 23], [1, 1]), // ds[0:3]
([7, 3], [1, 1], [9, 6], [1, 1]), // interior window across chunks
@@ -220,8 +223,10 @@ fn partial_hyperslabs_of_every_v4_chunk_index_match_h5py() {
.read_selection(&sel)
.unwrap_or_else(|e| panic!("{}: read_selection {sel:?} failed: {e}", case.name));
let got: Vec<i32> = raw
.chunks_exact(4)
.map(|b| i32::from_le_bytes(b.try_into().unwrap()))
.as_chunks::<4>()
.0
.iter()
.map(|b| i32::from_le_bytes(*b))
.collect();
assert_eq!(got, want, "{}: selection {sel:?}", case.name);
assert_eq!(