about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMartin Nordholts <martin.nordholts@codetale.se>2025-07-03 23:24:14 +0200
committerMartin Nordholts <martin.nordholts@codetale.se>2025-07-09 08:43:56 +0200
commit54cc45d5b4a949fa29813253efc7897e27f48fe2 (patch)
tree80e68efda754aaf13c74bf3561d491d31dbe8b7e
parent1b0bc594a75dfc1cdedc6c17052cf44de101e632 (diff)
downloadrust-54cc45d5b4a949fa29813253efc7897e27f48fe2.tar.gz
rust-54cc45d5b4a949fa29813253efc7897e27f48fe2.zip
tests: Don't check for self-printed output in std-backtrace.rs test
The `Display` implementation for `Backtrace` used to print

    stack backtrace:

but that print was later removed. To make the existing test pass, the
print was added to the existing test. But it doesn't make sense to check
for something that the test itself does since that will not detect any
regressions in the implementation of `Backtrace`. Fully remove the
checks.
-rw-r--r--tests/ui/backtrace/std-backtrace.rs8
1 files changed, 2 insertions, 6 deletions
diff --git a/tests/ui/backtrace/std-backtrace.rs b/tests/ui/backtrace/std-backtrace.rs
index 7ccbd46152b..b81bdee44e4 100644
--- a/tests/ui/backtrace/std-backtrace.rs
+++ b/tests/ui/backtrace/std-backtrace.rs
@@ -13,9 +13,9 @@ use std::str;
 fn main() {
     let args: Vec<String> = env::args().collect();
     if args.len() >= 2 && args[1] == "force" {
-        println!("stack backtrace:\n{}", std::backtrace::Backtrace::force_capture());
+        println!("{}", std::backtrace::Backtrace::force_capture());
     } else if args.len() >= 2 {
-        println!("stack backtrace:\n{}", std::backtrace::Backtrace::capture());
+        println!("{}", std::backtrace::Backtrace::capture());
     } else {
         runtest(&args[0]);
         println!("test ok");
@@ -28,7 +28,6 @@ fn runtest(me: &str) {
 
     let p = Command::new(me).arg("a").env("RUST_BACKTRACE", "1").output().unwrap();
     assert!(p.status.success());
-    assert!(String::from_utf8_lossy(&p.stdout).contains("stack backtrace:\n"));
     assert!(String::from_utf8_lossy(&p.stdout).contains("backtrace::main"));
 
     let p = Command::new(me).arg("a").env("RUST_BACKTRACE", "0").output().unwrap();
@@ -46,7 +45,6 @@ fn runtest(me: &str) {
         .output()
         .unwrap();
     assert!(p.status.success());
-    assert!(String::from_utf8_lossy(&p.stdout).contains("stack backtrace:\n"));
 
     let p = Command::new(me)
         .arg("a")
@@ -64,9 +62,7 @@ fn runtest(me: &str) {
         .output()
         .unwrap();
     assert!(p.status.success());
-    assert!(String::from_utf8_lossy(&p.stdout).contains("stack backtrace:\n"));
 
     let p = Command::new(me).arg("force").output().unwrap();
     assert!(p.status.success());
-    assert!(String::from_utf8_lossy(&p.stdout).contains("stack backtrace:\n"));
 }