diff options
Diffstat (limited to 'tests/ui/process/multi-panic.rs')
| -rw-r--r-- | tests/ui/process/multi-panic.rs | 32 |
1 files changed, 20 insertions, 12 deletions
diff --git a/tests/ui/process/multi-panic.rs b/tests/ui/process/multi-panic.rs index 02b69903654..ad47925a149 100644 --- a/tests/ui/process/multi-panic.rs +++ b/tests/ui/process/multi-panic.rs @@ -6,12 +6,17 @@ fn check_for_no_backtrace(test: std::process::Output) { assert!(!test.status.success()); let err = String::from_utf8_lossy(&test.stderr); - let mut it = err.lines(); + let mut it = err.lines().filter(|l| !l.is_empty()); assert_eq!(it.next().map(|l| l.starts_with("thread '<unnamed>' panicked")), Some(true)); assert_eq!(it.next().is_some(), true); - assert_eq!(it.next(), Some("note: run with `RUST_BACKTRACE=1` \ - environment variable to display a backtrace")); + assert_eq!( + it.next(), + Some( + "note: run with `RUST_BACKTRACE=1` \ + environment variable to display a backtrace" + ) + ); assert_eq!(it.next().map(|l| l.starts_with("thread 'main' panicked at")), Some(true)); assert_eq!(it.next().is_some(), true); assert_eq!(it.next(), None); @@ -22,19 +27,22 @@ fn main() { if args.len() > 1 && args[1] == "run_test" { let _ = std::thread::spawn(|| { panic!(); - }).join(); + }) + .join(); panic!(); } else { - let test = std::process::Command::new(&args[0]).arg("run_test") - .env_remove("RUST_BACKTRACE") - .output() - .unwrap(); + let test = std::process::Command::new(&args[0]) + .arg("run_test") + .env_remove("RUST_BACKTRACE") + .output() + .unwrap(); check_for_no_backtrace(test); - let test = std::process::Command::new(&args[0]).arg("run_test") - .env("RUST_BACKTRACE","0") - .output() - .unwrap(); + let test = std::process::Command::new(&args[0]) + .arg("run_test") + .env("RUST_BACKTRACE", "0") + .output() + .unwrap(); check_for_no_backtrace(test); } } |
