Skip to content

Commit da1febf

Browse files
committed
the expected ui output is now the empty String if the corresponding files are missing
1 parent bb7ab5c commit da1febf

File tree

1 file changed

+6
-9
lines changed

1 file changed

+6
-9
lines changed

src/tools/compiletest/src/runtest.rs

+6-9
Original file line numberDiff line numberDiff line change
@@ -2802,7 +2802,7 @@ impl<'test> TestCx<'test> {
28022802
normalized
28032803
}
28042804

2805-
fn expected_output_path(&self, kind: &str) -> Result<PathBuf, String> {
2805+
fn load_expected_output(&self, kind: &str) -> String {
28062806
let mut path = expected_output_path(&self.testpaths,
28072807
self.revision,
28082808
&self.config.compare_mode,
@@ -2814,18 +2814,15 @@ impl<'test> TestCx<'test> {
28142814
}
28152815

28162816
if path.exists() {
2817-
Ok(path)
2817+
match self.load_expected_output_from_path(&path) {
2818+
Ok(x) => x,
2819+
Err(x) => self.fatal(&x),
2820+
}
28182821
} else {
2819-
Err(String::from("no existing output_path found"))
2822+
String::new()
28202823
}
28212824
}
28222825

2823-
fn load_expected_output(&self, kind: &str) -> String {
2824-
self.expected_output_path(kind)
2825-
.and_then(|x| self.load_expected_output_from_path(&x))
2826-
.unwrap_or_else(|x| self.fatal(&x))
2827-
}
2828-
28292826
fn load_expected_output_from_path(&self, path: &Path) -> Result<String, String> {
28302827
let mut result = String::new();
28312828
match File::open(path).and_then(|mut f| f.read_to_string(&mut result)) {

0 commit comments

Comments
 (0)