Skip to content

Commit cd8e2d6

Browse files
committed
add additional read check on w3c tests to ensure generated file is correct
1 parent 0d96595 commit cd8e2d6

1 file changed

Lines changed: 13 additions & 1 deletion

File tree

src/builder.rs

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,19 @@ mod tests {
130130
.join(format!("{}_{}.hdt", parent_name.unwrap_or("root"), stem));
131131

132132
if let Err(e) = build_hdt(std::slice::from_ref(f), &out) {
133-
failures.push(format!("{f}: {e}"));
133+
failures.push(format!("{f}: build: {e}"));
134+
continue;
135+
}
136+
137+
let reader = match std::fs::File::open(&out) {
138+
Ok(file) => std::io::BufReader::new(file),
139+
Err(e) => {
140+
failures.push(format!("{f}: open: {e}"));
141+
continue;
142+
}
143+
};
144+
if let Err(e) = hdt::Hdt::read(reader) {
145+
failures.push(format!("{f}: read: {e}"));
134146
}
135147
}
136148

0 commit comments

Comments
 (0)