Skip to content

Commit 7a3a075

Browse files
feloyclaude
andcommitted
fix(test): propagate read error in ContainerfileCapture instead of silencing it
unwrap_or_default() swallowed file-read failures in the test helper, letting tests pass with empty content when the Containerfile was unreadable. Replaced with ? so the error surfaces immediately. Co-Authored-By: Claude Sonnet 4.6 <[email protected]> Signed-off-by: Philippe Martin <[email protected]>
1 parent 6bb4d93 commit 7a3a075

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -416,7 +416,7 @@ mod tests {
416416
.collect();
417417
if let Some(idx) = args.iter().position(|a| a == "-f") {
418418
if let Some(path) = args.get(idx + 1) {
419-
*self.0.lock().unwrap() = std::fs::read_to_string(path).unwrap_or_default();
419+
*self.0.lock().unwrap() = std::fs::read_to_string(path)?;
420420
}
421421
}
422422
Ok(Command::new("sh").args(["-c", "exit 0"]).status()?)

0 commit comments

Comments
 (0)