]> git.proxmox.com Git - cargo.git/commitdiff
Remove "Expected: execs" from testsuite error.
authorEric Huss <eric@huss.org>
Fri, 11 Jun 2021 22:25:50 +0000 (15:25 -0700)
committerEric Huss <eric@huss.org>
Fri, 11 Jun 2021 22:25:50 +0000 (15:25 -0700)
That message was not helpful.

crates/cargo-test-support/src/lib.rs

index 0ec061d721af0784d1a81259285f46d03894c383..ab035161299325bf36d22f2d8d6c7751f24197ce 100644 (file)
@@ -8,7 +8,6 @@
 
 use std::env;
 use std::ffi::OsStr;
-use std::fmt;
 use std::fs;
 use std::os;
 use std::path::{Path, PathBuf};
@@ -725,7 +724,7 @@ impl Execs {
         self.ran = true;
         let p = (&self.process_builder).clone().unwrap();
         if let Err(e) = self.match_process(&p) {
-            panic!("\nExpected: {:?}\n    but: {}", self, e)
+            panic!("\n{}", e)
         }
     }
 
@@ -733,7 +732,7 @@ impl Execs {
     pub fn run_output(&mut self, output: &Output) {
         self.ran = true;
         if let Err(e) = self.match_output(output) {
-            panic!("\nExpected: {:?}\n    but: {}", self, e)
+            panic!("\n{}", e)
         }
     }
 
@@ -1006,10 +1005,11 @@ impl Execs {
                     Ok(())
                 } else {
                     bail!(
-                        "differences:\n\
+                        "{} did not match:\n\
                          {}\n\n\
                          other output:\n\
                          `{}`",
+                        description,
                         diffs.join("\n"),
                         String::from_utf8_lossy(extra)
                     )
@@ -1404,12 +1404,6 @@ fn zip_all<T, I1: Iterator<Item = T>, I2: Iterator<Item = T>>(a: I1, b: I2) -> Z
     }
 }
 
-impl fmt::Debug for Execs {
-    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
-        write!(f, "execs")
-    }
-}
-
 pub fn execs() -> Execs {
     Execs {
         ran: false,