Skip to content

Commit 64ccff2

Browse files
committed
Auto merge of #13465 - epage:delete, r=weihanglo
test: Remove empty snapshots Inspired by #13461
2 parents 762c7d8 + ac453f1 commit 64ccff2

File tree

524 files changed

+527
-267
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

524 files changed

+527
-267
lines changed

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

+4-4
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ use std::fs;
1313
use std::os;
1414
use std::path::{Path, PathBuf};
1515
use std::process::{Command, Output};
16-
use std::str;
1716
use std::sync::OnceLock;
1817
use std::thread::JoinHandle;
1918
use std::time::{self, Duration};
@@ -36,6 +35,7 @@ macro_rules! t {
3635

3736
pub use snapbox::file;
3837
pub use snapbox::path::current_dir;
38+
pub use snapbox::str;
3939

4040
#[track_caller]
4141
pub fn panic_error(what: &str, err: impl Into<anyhow::Error>) -> ! {
@@ -972,8 +972,8 @@ impl Execs {
972972

973973
fn match_output(&self, code: Option<i32>, stdout: &[u8], stderr: &[u8]) -> Result<()> {
974974
self.verify_checks_output(stdout, stderr);
975-
let stdout = str::from_utf8(stdout).expect("stdout is not utf8");
976-
let stderr = str::from_utf8(stderr).expect("stderr is not utf8");
975+
let stdout = std::str::from_utf8(stdout).expect("stdout is not utf8");
976+
let stderr = std::str::from_utf8(stderr).expect("stderr is not utf8");
977977
let cwd = self.get_cwd();
978978

979979
match self.expect_exit_code {
@@ -1211,7 +1211,7 @@ pub trait TestEnv: Sized {
12111211
.exec_with_output()
12121212
{
12131213
Ok(output) => {
1214-
let s = str::from_utf8(&output.stdout).expect("utf8").trim();
1214+
let s = std::str::from_utf8(&output.stdout).expect("utf8").trim();
12151215
let mut p = PathBuf::from(s);
12161216
p.pop();
12171217
p

tests/testsuite/cargo/help/mod.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
use cargo_test_support::file;
22
use cargo_test_support::prelude::*;
3+
use cargo_test_support::str;
34

45
#[cargo_test]
56
fn case() {
@@ -8,5 +9,5 @@ fn case() {
89
.assert()
910
.success()
1011
.stdout_matches(file!["stdout.log"])
11-
.stderr_matches(file!["stderr.log"]);
12+
.stderr_matches(str![""]);
1213
}

tests/testsuite/cargo/help/stderr.log

Whitespace-only changes.

tests/testsuite/cargo/z_help/mod.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
use cargo_test_support::file;
22
use cargo_test_support::prelude::*;
3+
use cargo_test_support::str;
34

45
#[cargo_test]
56
fn case() {
@@ -9,5 +10,5 @@ fn case() {
910
.assert()
1011
.success()
1112
.stdout_matches(file!["stdout.log"])
12-
.stderr_matches(file!["stderr.log"]);
13+
.stderr_matches(str![""]);
1314
}

tests/testsuite/cargo/z_help/stderr.log

Whitespace-only changes.

tests/testsuite/cargo_add/add_basic/mod.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ use cargo_test_support::compare::assert_ui;
22
use cargo_test_support::current_dir;
33
use cargo_test_support::file;
44
use cargo_test_support::prelude::*;
5+
use cargo_test_support::str;
56
use cargo_test_support::Project;
67

78
#[cargo_test]
@@ -29,7 +30,7 @@ fn case() {
2930
.current_dir(cwd)
3031
.assert()
3132
.success()
32-
.stdout_matches(file!["stdout.log"])
33+
.stdout_matches(str![""])
3334
.stderr_matches(file!["stderr.log"]);
3435

3536
assert_ui().subset_matches(current_dir!().join("out"), &project_root);

tests/testsuite/cargo_add/add_basic/stdout.log

Whitespace-only changes.

tests/testsuite/cargo_add/add_multiple/mod.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ use cargo_test_support::compare::assert_ui;
22
use cargo_test_support::current_dir;
33
use cargo_test_support::file;
44
use cargo_test_support::prelude::*;
5+
use cargo_test_support::str;
56
use cargo_test_support::Project;
67

78
#[cargo_test]
@@ -31,7 +32,7 @@ fn case() {
3132
.current_dir(cwd)
3233
.assert()
3334
.success()
34-
.stdout_matches(file!["stdout.log"])
35+
.stdout_matches(str![""])
3536
.stderr_matches(file!["stderr.log"]);
3637

3738
assert_ui().subset_matches(current_dir!().join("out"), &project_root);

tests/testsuite/cargo_add/add_multiple/stdout.log

Whitespace-only changes.

tests/testsuite/cargo_add/add_normalized_name_external/mod.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ use cargo_test_support::compare::assert_ui;
22
use cargo_test_support::current_dir;
33
use cargo_test_support::file;
44
use cargo_test_support::prelude::*;
5+
use cargo_test_support::str;
56
use cargo_test_support::Project;
67

78
#[cargo_test]
@@ -34,7 +35,7 @@ fn case() {
3435
.current_dir(cwd)
3536
.assert()
3637
.success()
37-
.stdout_matches(file!["stdout.log"])
38+
.stdout_matches(str![""])
3839
.stderr_matches(file!["stderr.log"]);
3940

4041
assert_ui().subset_matches(current_dir!().join("out"), &project_root);

tests/testsuite/cargo_add/add_normalized_name_external/stdout.log

Whitespace-only changes.

tests/testsuite/cargo_add/add_toolchain/mod.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ use cargo_test_support::compare::assert_ui;
22
use cargo_test_support::current_dir;
33
use cargo_test_support::file;
44
use cargo_test_support::prelude::*;
5+
use cargo_test_support::str;
56
use cargo_test_support::Project;
67

78
#[cargo_test]
@@ -16,7 +17,7 @@ fn case() {
1617
.current_dir(cwd)
1718
.assert()
1819
.failure()
19-
.stdout_matches(file!["stdout.log"])
20+
.stdout_matches(str![""])
2021
.stderr_matches(file!["stderr.log"]);
2122

2223
assert_ui().subset_matches(current_dir!().join("out"), &project_root);

tests/testsuite/cargo_add/add_toolchain/stdout.log

Whitespace-only changes.

tests/testsuite/cargo_add/build/mod.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ use cargo_test_support::compare::assert_ui;
22
use cargo_test_support::current_dir;
33
use cargo_test_support::file;
44
use cargo_test_support::prelude::*;
5+
use cargo_test_support::str;
56
use cargo_test_support::Project;
67

78
#[cargo_test]
@@ -31,7 +32,7 @@ fn case() {
3132
.current_dir(cwd)
3233
.assert()
3334
.success()
34-
.stdout_matches(file!["stdout.log"])
35+
.stdout_matches(str![""])
3536
.stderr_matches(file!["stderr.log"]);
3637

3738
assert_ui().subset_matches(current_dir!().join("out"), &project_root);

tests/testsuite/cargo_add/build/stdout.log

Whitespace-only changes.

tests/testsuite/cargo_add/build_prefer_existing_version/mod.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ use cargo_test_support::compare::assert_ui;
22
use cargo_test_support::current_dir;
33
use cargo_test_support::file;
44
use cargo_test_support::prelude::*;
5+
use cargo_test_support::str;
56
use cargo_test_support::Project;
67

78
#[cargo_test]
@@ -31,7 +32,7 @@ fn case() {
3132
.current_dir(cwd)
3233
.assert()
3334
.success()
34-
.stdout_matches(file!["stdout.log"])
35+
.stdout_matches(str![""])
3536
.stderr_matches(file!["stderr.log"]);
3637

3738
assert_ui().subset_matches(current_dir!().join("out"), &project_root);

tests/testsuite/cargo_add/build_prefer_existing_version/stdout.log

Whitespace-only changes.

tests/testsuite/cargo_add/change_rename_target/mod.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ use cargo_test_support::compare::assert_ui;
22
use cargo_test_support::current_dir;
33
use cargo_test_support::file;
44
use cargo_test_support::prelude::*;
5+
use cargo_test_support::str;
56
use cargo_test_support::Project;
67

78
#[cargo_test]
@@ -31,7 +32,7 @@ fn case() {
3132
.current_dir(cwd)
3233
.assert()
3334
.success()
34-
.stdout_matches(file!["stdout.log"])
35+
.stdout_matches(str![""])
3536
.stderr_matches(file!["stderr.log"]);
3637

3738
assert_ui().subset_matches(current_dir!().join("out"), &project_root);

tests/testsuite/cargo_add/change_rename_target/stdout.log

Whitespace-only changes.

tests/testsuite/cargo_add/cyclic_features/mod.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ use cargo_test_support::compare::assert_ui;
22
use cargo_test_support::current_dir;
33
use cargo_test_support::file;
44
use cargo_test_support::prelude::*;
5+
use cargo_test_support::str;
56
use cargo_test_support::Project;
67

78
#[cargo_test]
@@ -23,7 +24,7 @@ fn case() {
2324
.current_dir(cwd)
2425
.assert()
2526
.success()
26-
.stdout_matches(file!["stdout.log"])
27+
.stdout_matches(str![""])
2728
.stderr_matches(file!["stderr.log"]);
2829

2930
assert_ui().subset_matches(current_dir!().join("out"), &project_root);

tests/testsuite/cargo_add/cyclic_features/stdout.log

Whitespace-only changes.

tests/testsuite/cargo_add/default_features/mod.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ use cargo_test_support::compare::assert_ui;
22
use cargo_test_support::current_dir;
33
use cargo_test_support::file;
44
use cargo_test_support::prelude::*;
5+
use cargo_test_support::str;
56
use cargo_test_support::Project;
67

78
#[cargo_test]
@@ -31,7 +32,7 @@ fn case() {
3132
.current_dir(cwd)
3233
.assert()
3334
.success()
34-
.stdout_matches(file!["stdout.log"])
35+
.stdout_matches(str![""])
3536
.stderr_matches(file!["stderr.log"]);
3637

3738
assert_ui().subset_matches(current_dir!().join("out"), &project_root);

tests/testsuite/cargo_add/default_features/stdout.log

Whitespace-only changes.

tests/testsuite/cargo_add/deprecated_default_features/mod.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ use cargo_test_support::compare::assert_ui;
22
use cargo_test_support::current_dir;
33
use cargo_test_support::file;
44
use cargo_test_support::prelude::*;
5+
use cargo_test_support::str;
56
use cargo_test_support::Project;
67

78
#[cargo_test]
@@ -29,7 +30,7 @@ fn case() {
2930
.current_dir(&cwd)
3031
.assert()
3132
.failure()
32-
.stdout_matches(file!["stdout.log"])
33+
.stdout_matches(str![""])
3334
.stderr_matches(file!["stderr.log"]);
3435

3536
assert_ui().subset_matches(current_dir!().join("out"), &project_root);

tests/testsuite/cargo_add/deprecated_default_features/stdout.log

Whitespace-only changes.

tests/testsuite/cargo_add/deprecated_section/mod.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ use cargo_test_support::compare::assert_ui;
22
use cargo_test_support::current_dir;
33
use cargo_test_support::file;
44
use cargo_test_support::prelude::*;
5+
use cargo_test_support::str;
56
use cargo_test_support::Project;
67

78
#[cargo_test]
@@ -29,7 +30,7 @@ fn case() {
2930
.current_dir(&cwd)
3031
.assert()
3132
.failure()
32-
.stdout_matches(file!["stdout.log"])
33+
.stdout_matches(str![""])
3334
.stderr_matches(file!["stderr.log"]);
3435

3536
assert_ui().subset_matches(current_dir!().join("out"), &project_root);

tests/testsuite/cargo_add/deprecated_section/stdout.log

Whitespace-only changes.

tests/testsuite/cargo_add/detect_workspace_inherit/mod.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ use cargo_test_support::compare::assert_ui;
22
use cargo_test_support::current_dir;
33
use cargo_test_support::file;
44
use cargo_test_support::prelude::*;
5+
use cargo_test_support::str;
56
use cargo_test_support::Project;
67

78
#[cargo_test]
@@ -18,7 +19,7 @@ fn case() {
1819
.current_dir(cwd)
1920
.assert()
2021
.success()
21-
.stdout_matches(file!["stdout.log"])
22+
.stdout_matches(str![""])
2223
.stderr_matches(file!["stderr.log"]);
2324

2425
assert_ui().subset_matches(current_dir!().join("out"), &project_root);

tests/testsuite/cargo_add/detect_workspace_inherit/stdout.log

Whitespace-only changes.

tests/testsuite/cargo_add/detect_workspace_inherit_features/mod.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ use cargo_test_support::compare::assert_ui;
22
use cargo_test_support::current_dir;
33
use cargo_test_support::file;
44
use cargo_test_support::prelude::*;
5+
use cargo_test_support::str;
56
use cargo_test_support::Project;
67

78
#[cargo_test]
@@ -18,7 +19,7 @@ fn case() {
1819
.current_dir(cwd)
1920
.assert()
2021
.success()
21-
.stdout_matches(file!["stdout.log"])
22+
.stdout_matches(str![""])
2223
.stderr_matches(file!["stderr.log"]);
2324

2425
assert_ui().subset_matches(current_dir!().join("out"), &project_root);

tests/testsuite/cargo_add/detect_workspace_inherit_features/stdout.log

Whitespace-only changes.

tests/testsuite/cargo_add/detect_workspace_inherit_optional/mod.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ use cargo_test_support::compare::assert_ui;
22
use cargo_test_support::current_dir;
33
use cargo_test_support::file;
44
use cargo_test_support::prelude::*;
5+
use cargo_test_support::str;
56
use cargo_test_support::Project;
67

78
#[cargo_test]
@@ -18,7 +19,7 @@ fn case() {
1819
.current_dir(cwd)
1920
.assert()
2021
.success()
21-
.stdout_matches(file!["stdout.log"])
22+
.stdout_matches(str![""])
2223
.stderr_matches(file!["stderr.log"]);
2324

2425
assert_ui().subset_matches(current_dir!().join("out"), &project_root);

tests/testsuite/cargo_add/detect_workspace_inherit_optional/stdout.log

Whitespace-only changes.

tests/testsuite/cargo_add/detect_workspace_inherit_public/mod.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ use cargo_test_support::compare::assert_ui;
22
use cargo_test_support::current_dir;
33
use cargo_test_support::file;
44
use cargo_test_support::prelude::*;
5+
use cargo_test_support::str;
56
use cargo_test_support::Project;
67

78
#[cargo_test]
@@ -19,7 +20,7 @@ fn case() {
1920
.current_dir(cwd)
2021
.assert()
2122
.success()
22-
.stdout_matches(file!["stdout.log"])
23+
.stdout_matches(str![""])
2324
.stderr_matches(file!["stderr.log"]);
2425

2526
assert_ui().subset_matches(current_dir!().join("out"), &project_root);

tests/testsuite/cargo_add/detect_workspace_inherit_public/stdout.log

Whitespace-only changes.

tests/testsuite/cargo_add/dev/mod.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ use cargo_test_support::compare::assert_ui;
22
use cargo_test_support::current_dir;
33
use cargo_test_support::file;
44
use cargo_test_support::prelude::*;
5+
use cargo_test_support::str;
56
use cargo_test_support::Project;
67

78
#[cargo_test]
@@ -31,7 +32,7 @@ fn case() {
3132
.current_dir(cwd)
3233
.assert()
3334
.success()
34-
.stdout_matches(file!["stdout.log"])
35+
.stdout_matches(str![""])
3536
.stderr_matches(file!["stderr.log"]);
3637

3738
assert_ui().subset_matches(current_dir!().join("out"), &project_root);

tests/testsuite/cargo_add/dev/stdout.log

Whitespace-only changes.

tests/testsuite/cargo_add/dev_build_conflict/mod.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ use cargo_test_support::compare::assert_ui;
22
use cargo_test_support::current_dir;
33
use cargo_test_support::file;
44
use cargo_test_support::prelude::*;
5+
use cargo_test_support::str;
56
use cargo_test_support::Project;
67

78
#[cargo_test]
@@ -29,7 +30,7 @@ fn case() {
2930
.current_dir(cwd)
3031
.assert()
3132
.code(1)
32-
.stdout_matches(file!["stdout.log"])
33+
.stdout_matches(str![""])
3334
.stderr_matches(file!["stderr.log"]);
3435

3536
assert_ui().subset_matches(current_dir!().join("out"), &project_root);

tests/testsuite/cargo_add/dev_build_conflict/stdout.log

Whitespace-only changes.

tests/testsuite/cargo_add/dev_prefer_existing_version/mod.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ use cargo_test_support::compare::assert_ui;
22
use cargo_test_support::current_dir;
33
use cargo_test_support::file;
44
use cargo_test_support::prelude::*;
5+
use cargo_test_support::str;
56
use cargo_test_support::Project;
67

78
#[cargo_test]
@@ -31,7 +32,7 @@ fn case() {
3132
.current_dir(cwd)
3233
.assert()
3334
.success()
34-
.stdout_matches(file!["stdout.log"])
35+
.stdout_matches(str![""])
3536
.stderr_matches(file!["stderr.log"]);
3637

3738
assert_ui().subset_matches(current_dir!().join("out"), &project_root);

tests/testsuite/cargo_add/dev_prefer_existing_version/stdout.log

Whitespace-only changes.

tests/testsuite/cargo_add/dry_run/mod.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ use cargo_test_support::compare::assert_ui;
22
use cargo_test_support::current_dir;
33
use cargo_test_support::file;
44
use cargo_test_support::prelude::*;
5+
use cargo_test_support::str;
56
use cargo_test_support::Project;
67

78
#[cargo_test]
@@ -29,7 +30,7 @@ fn case() {
2930
.current_dir(cwd)
3031
.assert()
3132
.success()
32-
.stdout_matches(file!["stdout.log"])
33+
.stdout_matches(str![""])
3334
.stderr_matches(file!["stderr.log"]);
3435

3536
assert_ui().subset_matches(current_dir!().join("out"), &project_root);

tests/testsuite/cargo_add/dry_run/stdout.log

Whitespace-only changes.

0 commit comments

Comments
 (0)