From 883980f2bd963819d6e92779cebf9ab15a3efd22 Mon Sep 17 00:00:00 2001 From: osobh Date: Fri, 25 Sep 2026 22:44:05 -0500 Subject: [PATCH] test: compare h5py's v1 compound field names with what clawhdf5 reads The test compared h5py against its own expected table, so it passed with the fix reverted. Found by the adversarial review. Co-Authored-By: Claude Opus 5.5 (1M context) --- crates/clawhdf5/tests/shared_message_v1.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/crates/clawhdf5/tests/shared_message_v1.rs b/crates/clawhdf5/tests/shared_message_v1.rs index 0873d03..80da855 100644 --- a/crates/clawhdf5/tests/shared_message_v1.rs +++ b/crates/clawhdf5/tests/shared_message_v1.rs @@ -107,8 +107,12 @@ with h5py.File("{path}", "r") as f: ); let stdout = String::from_utf8_lossy(&out.stdout); let theirs: Vec<&str> = stdout.lines().collect(); + // Read the types through clawhdf5, not from `expected()`, so this checks + // our reader against libhdf5 rather than the table against h5py. + let file = File::from_bytes(FIXTURE.to_vec()).unwrap(); let ours: Vec = expected() .into_iter() + .map(|(p, _)| (p, file.dataset(p).unwrap().dtype().unwrap())) .map(|(p, t)| match t { DType::Compound(fields) => { let names: Vec = fields.into_iter().map(|(n, _)| n).collect();