We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 237949b commit dcb0721Copy full SHA for dcb0721
src/tools/compiletest/src/runtest.rs
@@ -500,7 +500,19 @@ impl<'test> TestCx<'test> {
500
expected = expected.replace(&cr, "");
501
}
502
503
- self.compare_source(&expected, &actual);
+ if !self.config.bless {
504
+ self.compare_source(&expected, &actual);
505
+ } else if expected != actual {
506
+ let filepath_buf;
507
+ let filepath = match &self.props.pp_exact {
508
+ Some(file) => {
509
+ filepath_buf = self.testpaths.file.parent().unwrap().join(file);
510
+ &filepath_buf
511
+ }
512
+ None => &self.testpaths.file,
513
+ };
514
+ fs::write(filepath, &actual).unwrap();
515
516
517
// If we're only making sure that the output matches then just stop here
518
if self.props.pretty_compare_only {
0 commit comments