|
1 | 1 | //! Tests for the `cargo clean` command.
|
2 | 2 |
|
| 3 | +use cargo_test_support::compare::assert_e2e; |
3 | 4 | use cargo_test_support::prelude::*;
|
4 | 5 | use cargo_test_support::registry::Package;
|
5 | 6 | use cargo_test_support::str;
|
@@ -824,7 +825,6 @@ fn clean_spec_reserved() {
|
824 | 825 | .run();
|
825 | 826 | }
|
826 | 827 |
|
827 |
| -#[expect(deprecated)] |
828 | 828 | #[cargo_test]
|
829 | 829 | fn clean_dry_run() {
|
830 | 830 | // Basic `clean --dry-run` test.
|
@@ -866,11 +866,18 @@ fn clean_dry_run() {
|
866 | 866 | // Verify it didn't delete anything.
|
867 | 867 | let after = p.build_dir().ls_r();
|
868 | 868 | 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"); |
870 | 877 | eprintln!("{expected}");
|
871 | 878 | // Verify the verbose output.
|
872 | 879 | p.cargo("clean --dry-run -v")
|
873 |
| - .with_stdout_unordered(expected) |
| 880 | + .with_stdout_data(expected.unordered()) |
874 | 881 | .with_stderr_data(str![[r#"
|
875 | 882 | [SUMMARY] [FILE_NUM] files, [FILE_SIZE]B total
|
876 | 883 | [WARNING] no files deleted due to --dry-run
|
|
0 commit comments