提交 a135ced5 编写于 作者: O Oliver Scherer

Fix ui test blessing when a test has an empty stderr file after having had...

Fix ui test blessing when a test has an empty stderr file after having had content there before the current changes
上级 66f7a5d9
......@@ -3338,6 +3338,10 @@ fn load_expected_output_from_path(&self, path: &Path) -> Result<String, String>
}
fn delete_file(&self, file: &PathBuf) {
if !file.exists() {
// Deleting a nonexistant file would error.
return;
}
if let Err(e) = fs::remove_file(file) {
self.fatal(&format!("failed to delete `{}`: {}", file.display(), e,));
}
......@@ -3400,7 +3404,7 @@ fn prune_duplicate_output(&self, mode: CompareMode, kind: &str, canon_content: &
let examined_content =
self.load_expected_output_from_path(&examined_path).unwrap_or_else(|_| String::new());
if examined_path.exists() && canon_content == &examined_content {
if canon_content == &examined_content {
self.delete_file(&examined_path);
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册