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.
This commit is contained in:
parent
1b0bc594a7
commit
54cc45d5b4
1 changed files with 2 additions and 6 deletions
|
|
@ -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"));
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue