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) <[email protected]>
This commit is contained in:
osobh
2026-09-25 22:44:05 -05:00
co-authored by Claude Opus 5.5
parent d6e426e6d5
commit 883980f2bd
@@ -107,8 +107,12 @@ with h5py.File("{path}", "r") as f:
); );
let stdout = String::from_utf8_lossy(&out.stdout); let stdout = String::from_utf8_lossy(&out.stdout);
let theirs: Vec<&str> = stdout.lines().collect(); 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<String> = expected() let ours: Vec<String> = expected()
.into_iter() .into_iter()
.map(|(p, _)| (p, file.dataset(p).unwrap().dtype().unwrap()))
.map(|(p, t)| match t { .map(|(p, t)| match t {
DType::Compound(fields) => { DType::Compound(fields) => {
let names: Vec<String> = fields.into_iter().map(|(n, _)| n).collect(); let names: Vec<String> = fields.into_iter().map(|(n, _)| n).collect();