test: Remove empty snapshots for help

This commit is contained in:
Ed Page 2024-02-20 13:05:16 -06:00
parent 3209eaebae
commit 2e878a4c38
83 changed files with 86 additions and 45 deletions

View File

@ -13,7 +13,6 @@ use std::fs;
use std::os; use std::os;
use std::path::{Path, PathBuf}; use std::path::{Path, PathBuf};
use std::process::{Command, Output}; use std::process::{Command, Output};
use std::str;
use std::sync::OnceLock; use std::sync::OnceLock;
use std::thread::JoinHandle; use std::thread::JoinHandle;
use std::time::{self, Duration}; use std::time::{self, Duration};
@ -36,6 +35,7 @@ macro_rules! t {
pub use snapbox::file; pub use snapbox::file;
pub use snapbox::path::current_dir; pub use snapbox::path::current_dir;
pub use snapbox::str;
#[track_caller] #[track_caller]
pub fn panic_error(what: &str, err: impl Into<anyhow::Error>) -> ! { pub fn panic_error(what: &str, err: impl Into<anyhow::Error>) -> ! {
@ -972,8 +972,8 @@ impl Execs {
fn match_output(&self, code: Option<i32>, stdout: &[u8], stderr: &[u8]) -> Result<()> { fn match_output(&self, code: Option<i32>, stdout: &[u8], stderr: &[u8]) -> Result<()> {
self.verify_checks_output(stdout, stderr); self.verify_checks_output(stdout, stderr);
let stdout = str::from_utf8(stdout).expect("stdout is not utf8"); let stdout = std::str::from_utf8(stdout).expect("stdout is not utf8");
let stderr = str::from_utf8(stderr).expect("stderr is not utf8"); let stderr = std::str::from_utf8(stderr).expect("stderr is not utf8");
let cwd = self.get_cwd(); let cwd = self.get_cwd();
match self.expect_exit_code { match self.expect_exit_code {
@ -1211,7 +1211,7 @@ pub trait TestEnv: Sized {
.exec_with_output() .exec_with_output()
{ {
Ok(output) => { Ok(output) => {
let s = str::from_utf8(&output.stdout).expect("utf8").trim(); let s = std::str::from_utf8(&output.stdout).expect("utf8").trim();
let mut p = PathBuf::from(s); let mut p = PathBuf::from(s);
p.pop(); p.pop();
p p

View File

@ -1,5 +1,6 @@
use cargo_test_support::file; use cargo_test_support::file;
use cargo_test_support::prelude::*; use cargo_test_support::prelude::*;
use cargo_test_support::str;
#[cargo_test] #[cargo_test]
fn case() { fn case() {
@ -8,5 +9,5 @@ fn case() {
.assert() .assert()
.success() .success()
.stdout_matches(file!["stdout.log"]) .stdout_matches(file!["stdout.log"])
.stderr_matches(file!["stderr.log"]); .stderr_matches(str![""]);
} }

View File

@ -1,5 +1,6 @@
use cargo_test_support::file; use cargo_test_support::file;
use cargo_test_support::prelude::*; use cargo_test_support::prelude::*;
use cargo_test_support::str;
#[cargo_test] #[cargo_test]
fn case() { fn case() {
@ -9,5 +10,5 @@ fn case() {
.assert() .assert()
.success() .success()
.stdout_matches(file!["stdout.log"]) .stdout_matches(file!["stdout.log"])
.stderr_matches(file!["stderr.log"]); .stderr_matches(str![""]);
} }

View File

@ -1,5 +1,6 @@
use cargo_test_support::file; use cargo_test_support::file;
use cargo_test_support::prelude::*; use cargo_test_support::prelude::*;
use cargo_test_support::str;
#[cargo_test] #[cargo_test]
fn case() { fn case() {
@ -9,5 +10,5 @@ fn case() {
.assert() .assert()
.success() .success()
.stdout_matches(file!["stdout.log"]) .stdout_matches(file!["stdout.log"])
.stderr_matches(file!["stderr.log"]); .stderr_matches(str![""]);
} }

View File

@ -2,6 +2,7 @@ use cargo_test_support::compare::assert_ui;
use cargo_test_support::current_dir; use cargo_test_support::current_dir;
use cargo_test_support::file; use cargo_test_support::file;
use cargo_test_support::prelude::*; use cargo_test_support::prelude::*;
use cargo_test_support::str;
use cargo_test_support::Project; use cargo_test_support::Project;
#[cargo_test] #[cargo_test]
@ -25,7 +26,7 @@ fn case() {
.assert() .assert()
.success() .success()
.stdout_matches(file!["stdout.log"]) .stdout_matches(file!["stdout.log"])
.stderr_matches(file!["stderr.log"]); .stderr_matches(str![""]);
assert_ui().subset_matches(current_dir!().join("out"), &project_root); assert_ui().subset_matches(current_dir!().join("out"), &project_root);
} }

View File

@ -1,5 +1,6 @@
use cargo_test_support::file; use cargo_test_support::file;
use cargo_test_support::prelude::*; use cargo_test_support::prelude::*;
use cargo_test_support::str;
#[cargo_test] #[cargo_test]
fn case() { fn case() {
@ -9,5 +10,5 @@ fn case() {
.assert() .assert()
.success() .success()
.stdout_matches(file!["stdout.log"]) .stdout_matches(file!["stdout.log"])
.stderr_matches(file!["stderr.log"]); .stderr_matches(str![""]);
} }

View File

@ -1,5 +1,6 @@
use cargo_test_support::file; use cargo_test_support::file;
use cargo_test_support::prelude::*; use cargo_test_support::prelude::*;
use cargo_test_support::str;
#[cargo_test] #[cargo_test]
fn case() { fn case() {
@ -9,5 +10,5 @@ fn case() {
.assert() .assert()
.success() .success()
.stdout_matches(file!["stdout.log"]) .stdout_matches(file!["stdout.log"])
.stderr_matches(file!["stderr.log"]); .stderr_matches(str![""]);
} }

View File

@ -1,5 +1,6 @@
use cargo_test_support::file; use cargo_test_support::file;
use cargo_test_support::prelude::*; use cargo_test_support::prelude::*;
use cargo_test_support::str;
#[cargo_test] #[cargo_test]
fn case() { fn case() {
@ -9,5 +10,5 @@ fn case() {
.assert() .assert()
.success() .success()
.stdout_matches(file!["stdout.log"]) .stdout_matches(file!["stdout.log"])
.stderr_matches(file!["stderr.log"]); .stderr_matches(str![""]);
} }

View File

@ -1,5 +1,6 @@
use cargo_test_support::file; use cargo_test_support::file;
use cargo_test_support::prelude::*; use cargo_test_support::prelude::*;
use cargo_test_support::str;
#[cargo_test] #[cargo_test]
fn case() { fn case() {
@ -9,5 +10,5 @@ fn case() {
.assert() .assert()
.success() .success()
.stdout_matches(file!["stdout.log"]) .stdout_matches(file!["stdout.log"])
.stderr_matches(file!["stderr.log"]); .stderr_matches(str![""]);
} }

View File

@ -1,5 +1,6 @@
use cargo_test_support::file; use cargo_test_support::file;
use cargo_test_support::prelude::*; use cargo_test_support::prelude::*;
use cargo_test_support::str;
#[cargo_test] #[cargo_test]
fn case() { fn case() {
@ -9,5 +10,5 @@ fn case() {
.assert() .assert()
.success() .success()
.stdout_matches(file!["stdout.log"]) .stdout_matches(file!["stdout.log"])
.stderr_matches(file!["stderr.log"]); .stderr_matches(str![""]);
} }

View File

@ -1,5 +1,6 @@
use cargo_test_support::file; use cargo_test_support::file;
use cargo_test_support::prelude::*; use cargo_test_support::prelude::*;
use cargo_test_support::str;
#[cargo_test] #[cargo_test]
fn case() { fn case() {
@ -9,5 +10,5 @@ fn case() {
.assert() .assert()
.success() .success()
.stdout_matches(file!["stdout.log"]) .stdout_matches(file!["stdout.log"])
.stderr_matches(file!["stderr.log"]); .stderr_matches(str![""]);
} }

View File

@ -1,5 +1,6 @@
use cargo_test_support::file; use cargo_test_support::file;
use cargo_test_support::prelude::*; use cargo_test_support::prelude::*;
use cargo_test_support::str;
#[cargo_test] #[cargo_test]
fn case() { fn case() {
@ -9,5 +10,5 @@ fn case() {
.assert() .assert()
.success() .success()
.stdout_matches(file!["stdout.log"]) .stdout_matches(file!["stdout.log"])
.stderr_matches(file!["stderr.log"]); .stderr_matches(str![""]);
} }

View File

@ -1,5 +1,6 @@
use cargo_test_support::file; use cargo_test_support::file;
use cargo_test_support::prelude::*; use cargo_test_support::prelude::*;
use cargo_test_support::str;
#[cargo_test] #[cargo_test]
fn case() { fn case() {
@ -9,5 +10,5 @@ fn case() {
.assert() .assert()
.success() .success()
.stdout_matches(file!["stdout.log"]) .stdout_matches(file!["stdout.log"])
.stderr_matches(file!["stderr.log"]); .stderr_matches(str![""]);
} }

View File

@ -1,5 +1,6 @@
use cargo_test_support::file; use cargo_test_support::file;
use cargo_test_support::prelude::*; use cargo_test_support::prelude::*;
use cargo_test_support::str;
#[cargo_test] #[cargo_test]
fn case() { fn case() {
@ -9,5 +10,5 @@ fn case() {
.assert() .assert()
.success() .success()
.stdout_matches(file!["stdout.log"]) .stdout_matches(file!["stdout.log"])
.stderr_matches(file!["stderr.log"]); .stderr_matches(str![""]);
} }

View File

@ -1,5 +1,6 @@
use cargo_test_support::file; use cargo_test_support::file;
use cargo_test_support::prelude::*; use cargo_test_support::prelude::*;
use cargo_test_support::str;
#[cargo_test] #[cargo_test]
fn case() { fn case() {
@ -9,5 +10,5 @@ fn case() {
.assert() .assert()
.success() .success()
.stdout_matches(file!["stdout.log"]) .stdout_matches(file!["stdout.log"])
.stderr_matches(file!["stderr.log"]); .stderr_matches(str![""]);
} }

View File

@ -1,5 +1,6 @@
use cargo_test_support::file; use cargo_test_support::file;
use cargo_test_support::prelude::*; use cargo_test_support::prelude::*;
use cargo_test_support::str;
#[cargo_test] #[cargo_test]
fn case() { fn case() {
@ -9,5 +10,5 @@ fn case() {
.assert() .assert()
.success() .success()
.stdout_matches(file!["stdout.log"]) .stdout_matches(file!["stdout.log"])
.stderr_matches(file!["stderr.log"]); .stderr_matches(str![""]);
} }

View File

@ -1,5 +1,6 @@
use cargo_test_support::file; use cargo_test_support::file;
use cargo_test_support::prelude::*; use cargo_test_support::prelude::*;
use cargo_test_support::str;
#[cargo_test] #[cargo_test]
fn case() { fn case() {
@ -9,5 +10,5 @@ fn case() {
.assert() .assert()
.success() .success()
.stdout_matches(file!["stdout.log"]) .stdout_matches(file!["stdout.log"])
.stderr_matches(file!["stderr.log"]); .stderr_matches(str![""]);
} }

View File

@ -1,5 +1,6 @@
use cargo_test_support::file; use cargo_test_support::file;
use cargo_test_support::prelude::*; use cargo_test_support::prelude::*;
use cargo_test_support::str;
#[cargo_test] #[cargo_test]
fn case() { fn case() {
@ -9,5 +10,5 @@ fn case() {
.assert() .assert()
.success() .success()
.stdout_matches(file!["stdout.log"]) .stdout_matches(file!["stdout.log"])
.stderr_matches(file!["stderr.log"]); .stderr_matches(str![""]);
} }

View File

@ -1,5 +1,6 @@
use cargo_test_support::file; use cargo_test_support::file;
use cargo_test_support::prelude::*; use cargo_test_support::prelude::*;
use cargo_test_support::str;
#[cargo_test] #[cargo_test]
fn case() { fn case() {
@ -9,5 +10,5 @@ fn case() {
.assert() .assert()
.success() .success()
.stdout_matches(file!["stdout.log"]) .stdout_matches(file!["stdout.log"])
.stderr_matches(file!["stderr.log"]); .stderr_matches(str![""]);
} }

View File

@ -1,5 +1,6 @@
use cargo_test_support::file; use cargo_test_support::file;
use cargo_test_support::prelude::*; use cargo_test_support::prelude::*;
use cargo_test_support::str;
#[cargo_test] #[cargo_test]
fn case() { fn case() {
@ -9,5 +10,5 @@ fn case() {
.assert() .assert()
.success() .success()
.stdout_matches(file!["stdout.log"]) .stdout_matches(file!["stdout.log"])
.stderr_matches(file!["stderr.log"]); .stderr_matches(str![""]);
} }

View File

@ -1,5 +1,6 @@
use cargo_test_support::file; use cargo_test_support::file;
use cargo_test_support::prelude::*; use cargo_test_support::prelude::*;
use cargo_test_support::str;
#[cargo_test] #[cargo_test]
fn case() { fn case() {
@ -9,5 +10,5 @@ fn case() {
.assert() .assert()
.success() .success()
.stdout_matches(file!["stdout.log"]) .stdout_matches(file!["stdout.log"])
.stderr_matches(file!["stderr.log"]); .stderr_matches(str![""]);
} }

View File

@ -1,5 +1,6 @@
use cargo_test_support::file; use cargo_test_support::file;
use cargo_test_support::prelude::*; use cargo_test_support::prelude::*;
use cargo_test_support::str;
#[cargo_test] #[cargo_test]
fn case() { fn case() {
@ -9,5 +10,5 @@ fn case() {
.assert() .assert()
.success() .success()
.stdout_matches(file!["stdout.log"]) .stdout_matches(file!["stdout.log"])
.stderr_matches(file!["stderr.log"]); .stderr_matches(str![""]);
} }

View File

@ -1,5 +1,6 @@
use cargo_test_support::file; use cargo_test_support::file;
use cargo_test_support::prelude::*; use cargo_test_support::prelude::*;
use cargo_test_support::str;
#[cargo_test] #[cargo_test]
fn case() { fn case() {
@ -9,5 +10,5 @@ fn case() {
.assert() .assert()
.success() .success()
.stdout_matches(file!["stdout.log"]) .stdout_matches(file!["stdout.log"])
.stderr_matches(file!["stderr.log"]); .stderr_matches(str![""]);
} }

View File

@ -1,5 +1,6 @@
use cargo_test_support::file; use cargo_test_support::file;
use cargo_test_support::prelude::*; use cargo_test_support::prelude::*;
use cargo_test_support::str;
#[cargo_test] #[cargo_test]
fn case() { fn case() {
@ -9,5 +10,5 @@ fn case() {
.assert() .assert()
.success() .success()
.stdout_matches(file!["stdout.log"]) .stdout_matches(file!["stdout.log"])
.stderr_matches(file!["stderr.log"]); .stderr_matches(str![""]);
} }

View File

@ -1,5 +1,6 @@
use cargo_test_support::file; use cargo_test_support::file;
use cargo_test_support::prelude::*; use cargo_test_support::prelude::*;
use cargo_test_support::str;
#[cargo_test] #[cargo_test]
fn case() { fn case() {
@ -9,5 +10,5 @@ fn case() {
.assert() .assert()
.success() .success()
.stdout_matches(file!["stdout.log"]) .stdout_matches(file!["stdout.log"])
.stderr_matches(file!["stderr.log"]); .stderr_matches(str![""]);
} }

View File

@ -1,5 +1,6 @@
use cargo_test_support::file; use cargo_test_support::file;
use cargo_test_support::prelude::*; use cargo_test_support::prelude::*;
use cargo_test_support::str;
#[cargo_test] #[cargo_test]
fn case() { fn case() {
@ -9,5 +10,5 @@ fn case() {
.assert() .assert()
.success() .success()
.stdout_matches(file!["stdout.log"]) .stdout_matches(file!["stdout.log"])
.stderr_matches(file!["stderr.log"]); .stderr_matches(str![""]);
} }

View File

@ -1,5 +1,6 @@
use cargo_test_support::file; use cargo_test_support::file;
use cargo_test_support::prelude::*; use cargo_test_support::prelude::*;
use cargo_test_support::str;
#[cargo_test] #[cargo_test]
fn case() { fn case() {
@ -9,5 +10,5 @@ fn case() {
.assert() .assert()
.success() .success()
.stdout_matches(file!["stdout.log"]) .stdout_matches(file!["stdout.log"])
.stderr_matches(file!["stderr.log"]); .stderr_matches(str![""]);
} }

View File

@ -1,5 +1,6 @@
use cargo_test_support::file; use cargo_test_support::file;
use cargo_test_support::prelude::*; use cargo_test_support::prelude::*;
use cargo_test_support::str;
#[cargo_test] #[cargo_test]
fn case() { fn case() {
@ -9,5 +10,5 @@ fn case() {
.assert() .assert()
.success() .success()
.stdout_matches(file!["stdout.log"]) .stdout_matches(file!["stdout.log"])
.stderr_matches(file!["stderr.log"]); .stderr_matches(str![""]);
} }

View File

@ -1,5 +1,6 @@
use cargo_test_support::file; use cargo_test_support::file;
use cargo_test_support::prelude::*; use cargo_test_support::prelude::*;
use cargo_test_support::str;
#[cargo_test] #[cargo_test]
fn case() { fn case() {
@ -9,5 +10,5 @@ fn case() {
.assert() .assert()
.success() .success()
.stdout_matches(file!["stdout.log"]) .stdout_matches(file!["stdout.log"])
.stderr_matches(file!["stderr.log"]); .stderr_matches(str![""]);
} }

View File

@ -1,5 +1,6 @@
use cargo_test_support::file; use cargo_test_support::file;
use cargo_test_support::prelude::*; use cargo_test_support::prelude::*;
use cargo_test_support::str;
#[cargo_test] #[cargo_test]
fn case() { fn case() {
@ -9,5 +10,5 @@ fn case() {
.assert() .assert()
.success() .success()
.stdout_matches(file!["stdout.log"]) .stdout_matches(file!["stdout.log"])
.stderr_matches(file!["stderr.log"]); .stderr_matches(str![""]);
} }

View File

@ -1,5 +1,6 @@
use cargo_test_support::file; use cargo_test_support::file;
use cargo_test_support::prelude::*; use cargo_test_support::prelude::*;
use cargo_test_support::str;
#[cargo_test] #[cargo_test]
fn case() { fn case() {
@ -9,5 +10,5 @@ fn case() {
.assert() .assert()
.success() .success()
.stdout_matches(file!["stdout.log"]) .stdout_matches(file!["stdout.log"])
.stderr_matches(file!["stderr.log"]); .stderr_matches(str![""]);
} }

View File

@ -1,5 +1,6 @@
use cargo_test_support::file; use cargo_test_support::file;
use cargo_test_support::prelude::*; use cargo_test_support::prelude::*;
use cargo_test_support::str;
#[cargo_test] #[cargo_test]
fn case() { fn case() {
@ -9,5 +10,5 @@ fn case() {
.assert() .assert()
.success() .success()
.stdout_matches(file!["stdout.log"]) .stdout_matches(file!["stdout.log"])
.stderr_matches(file!["stderr.log"]); .stderr_matches(str![""]);
} }

View File

@ -1,5 +1,6 @@
use cargo_test_support::file; use cargo_test_support::file;
use cargo_test_support::prelude::*; use cargo_test_support::prelude::*;
use cargo_test_support::str;
#[cargo_test] #[cargo_test]
fn case() { fn case() {
@ -9,5 +10,5 @@ fn case() {
.assert() .assert()
.success() .success()
.stdout_matches(file!["stdout.log"]) .stdout_matches(file!["stdout.log"])
.stderr_matches(file!["stderr.log"]); .stderr_matches(str![""]);
} }

View File

@ -1,5 +1,6 @@
use cargo_test_support::file; use cargo_test_support::file;
use cargo_test_support::prelude::*; use cargo_test_support::prelude::*;
use cargo_test_support::str;
#[cargo_test] #[cargo_test]
fn case() { fn case() {
@ -9,5 +10,5 @@ fn case() {
.assert() .assert()
.success() .success()
.stdout_matches(file!["stdout.log"]) .stdout_matches(file!["stdout.log"])
.stderr_matches(file!["stderr.log"]); .stderr_matches(str![""]);
} }

View File

@ -1,5 +1,6 @@
use cargo_test_support::file; use cargo_test_support::file;
use cargo_test_support::prelude::*; use cargo_test_support::prelude::*;
use cargo_test_support::str;
#[cargo_test] #[cargo_test]
fn case() { fn case() {
@ -9,5 +10,5 @@ fn case() {
.assert() .assert()
.success() .success()
.stdout_matches(file!["stdout.log"]) .stdout_matches(file!["stdout.log"])
.stderr_matches(file!["stderr.log"]); .stderr_matches(str![""]);
} }

View File

@ -1,5 +1,6 @@
use cargo_test_support::file; use cargo_test_support::file;
use cargo_test_support::prelude::*; use cargo_test_support::prelude::*;
use cargo_test_support::str;
#[cargo_test] #[cargo_test]
fn case() { fn case() {
@ -9,5 +10,5 @@ fn case() {
.assert() .assert()
.success() .success()
.stdout_matches(file!["stdout.log"]) .stdout_matches(file!["stdout.log"])
.stderr_matches(file!["stderr.log"]); .stderr_matches(str![""]);
} }

View File

@ -1,5 +1,6 @@
use cargo_test_support::file; use cargo_test_support::file;
use cargo_test_support::prelude::*; use cargo_test_support::prelude::*;
use cargo_test_support::str;
#[cargo_test] #[cargo_test]
fn case() { fn case() {
@ -9,5 +10,5 @@ fn case() {
.assert() .assert()
.success() .success()
.stdout_matches(file!["stdout.log"]) .stdout_matches(file!["stdout.log"])
.stderr_matches(file!["stderr.log"]); .stderr_matches(str![""]);
} }

View File

@ -1,5 +1,6 @@
use cargo_test_support::file; use cargo_test_support::file;
use cargo_test_support::prelude::*; use cargo_test_support::prelude::*;
use cargo_test_support::str;
#[cargo_test] #[cargo_test]
fn case() { fn case() {
@ -9,5 +10,5 @@ fn case() {
.assert() .assert()
.success() .success()
.stdout_matches(file!["stdout.log"]) .stdout_matches(file!["stdout.log"])
.stderr_matches(file!["stderr.log"]); .stderr_matches(str![""]);
} }

View File

@ -1,5 +1,6 @@
use cargo_test_support::file; use cargo_test_support::file;
use cargo_test_support::prelude::*; use cargo_test_support::prelude::*;
use cargo_test_support::str;
#[cargo_test] #[cargo_test]
fn case() { fn case() {
@ -9,5 +10,5 @@ fn case() {
.assert() .assert()
.success() .success()
.stdout_matches(file!["stdout.log"]) .stdout_matches(file!["stdout.log"])
.stderr_matches(file!["stderr.log"]); .stderr_matches(str![""]);
} }

View File

@ -1,5 +1,6 @@
use cargo_test_support::file; use cargo_test_support::file;
use cargo_test_support::prelude::*; use cargo_test_support::prelude::*;
use cargo_test_support::str;
#[cargo_test] #[cargo_test]
fn case() { fn case() {
@ -9,5 +10,5 @@ fn case() {
.assert() .assert()
.success() .success()
.stdout_matches(file!["stdout.log"]) .stdout_matches(file!["stdout.log"])
.stderr_matches(file!["stderr.log"]); .stderr_matches(str![""]);
} }

View File

@ -1,5 +1,6 @@
use cargo_test_support::file; use cargo_test_support::file;
use cargo_test_support::prelude::*; use cargo_test_support::prelude::*;
use cargo_test_support::str;
#[cargo_test] #[cargo_test]
fn case() { fn case() {
@ -9,5 +10,5 @@ fn case() {
.assert() .assert()
.success() .success()
.stdout_matches(file!["stdout.log"]) .stdout_matches(file!["stdout.log"])
.stderr_matches(file!["stderr.log"]); .stderr_matches(str![""]);
} }

View File

@ -1,5 +1,6 @@
use cargo_test_support::file; use cargo_test_support::file;
use cargo_test_support::prelude::*; use cargo_test_support::prelude::*;
use cargo_test_support::str;
#[cargo_test] #[cargo_test]
fn case() { fn case() {
@ -9,5 +10,5 @@ fn case() {
.assert() .assert()
.success() .success()
.stdout_matches(file!["stdout.log"]) .stdout_matches(file!["stdout.log"])
.stderr_matches(file!["stderr.log"]); .stderr_matches(str![""]);
} }