Skip to content

Commit

Permalink
test(clean): Update remaining unordered test to snapbox
Browse files Browse the repository at this point in the history
  • Loading branch information
epage committed Nov 4, 2024
1 parent 2fcc375 commit 91e06e9
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions tests/testsuite/clean.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
//! Tests for the `cargo clean` command.

use cargo_test_support::compare::assert_e2e;
use cargo_test_support::prelude::*;
use cargo_test_support::registry::Package;
use cargo_test_support::str;
Expand Down Expand Up @@ -824,7 +825,6 @@ fn clean_spec_reserved() {
.run();
}

#[expect(deprecated)]
#[cargo_test]
fn clean_dry_run() {
// Basic `clean --dry-run` test.
Expand Down Expand Up @@ -866,11 +866,18 @@ fn clean_dry_run() {
// Verify it didn't delete anything.
let after = p.build_dir().ls_r();
assert_eq!(before, after);
let expected = itertools::join(before.iter().map(|p| p.to_str().unwrap()), "\n");
let assert = assert_e2e();
let mut expected = itertools::join(
before
.iter()
.map(|p| assert.redactions().redact(p.to_str().unwrap())),
"\n",
);
expected.push_str("\n");
eprintln!("{expected}");
// Verify the verbose output.
p.cargo("clean --dry-run -v")
.with_stdout_unordered(expected)
.with_stdout_data(expected.unordered())
.with_stderr_data(str![[r#"
[SUMMARY] [FILE_NUM] files, [FILE_SIZE]B total
[WARNING] no files deleted due to --dry-run
Expand Down

0 comments on commit 91e06e9

Please sign in to comment.