Skip to content

Commit 52ec93d

Browse files
committed
test(clean): Update remaining unordered test to snapbox
1 parent 2fcc375 commit 52ec93d

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

tests/testsuite/clean.rs

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
//! Tests for the `cargo clean` command.
22
3+
use cargo_test_support::compare::assert_e2e;
34
use cargo_test_support::prelude::*;
45
use cargo_test_support::registry::Package;
56
use cargo_test_support::str;
@@ -824,7 +825,6 @@ fn clean_spec_reserved() {
824825
.run();
825826
}
826827

827-
#[expect(deprecated)]
828828
#[cargo_test]
829829
fn clean_dry_run() {
830830
// Basic `clean --dry-run` test.
@@ -866,11 +866,18 @@ fn clean_dry_run() {
866866
// Verify it didn't delete anything.
867867
let after = p.build_dir().ls_r();
868868
assert_eq!(before, after);
869-
let expected = itertools::join(before.iter().map(|p| p.to_str().unwrap()), "\n");
869+
let assert = assert_e2e();
870+
let mut expected = snapbox::filter::normalize_paths(&itertools::join(
871+
before
872+
.iter()
873+
.map(|p| assert.redactions().redact(p.to_str().unwrap())),
874+
"\n",
875+
));
876+
expected.push_str("\n");
870877
eprintln!("{expected}");
871878
// Verify the verbose output.
872879
p.cargo("clean --dry-run -v")
873-
.with_stdout_unordered(expected)
880+
.with_stdout_data(expected.unordered())
874881
.with_stderr_data(str![[r#"
875882
[SUMMARY] [FILE_NUM] files, [FILE_SIZE]B total
876883
[WARNING] no files deleted due to --dry-run

0 commit comments

Comments
 (0)