Skip to content

Commit 1794ce4

Browse files
committed
test: Revert clean_dry_run for expected path not normalized
1 parent b3a9dec commit 1794ce4

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

tests/testsuite/clean.rs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -825,6 +825,7 @@ fn clean_spec_reserved() {
825825
.run();
826826
}
827827

828+
#[allow(deprecated)]
828829
#[cargo_test]
829830
fn clean_dry_run() {
830831
// Basic `clean --dry-run` test.
@@ -866,15 +867,11 @@ fn clean_dry_run() {
866867
// Verify it didn't delete anything.
867868
let after = p.build_dir().ls_r();
868869
assert_eq!(before, after);
869-
let path_stringify = |p: &PathBuf| format!("{}\n", p.to_str().unwrap());
870-
let files = itertools::join(before.iter().map(path_stringify), "");
871-
let re = regex::Regex::new("/(?<head>[a-z0-9\\-_]+)-([0-9a-f]{16})(?<tail>.*)").unwrap();
872-
let expected = re.replace_all(&files, "/$head-[HASH]$tail");
873-
let expected = expected.replace(p.build_dir().to_str().unwrap(), "[ROOT]/foo/target");
870+
let expected = itertools::join(before.iter().map(|p| p.to_str().unwrap()), "\n");
874871
eprintln!("{expected}");
875872
// Verify the verbose output.
876873
p.cargo("clean --dry-run -v")
877-
.with_stdout_data(expected.unordered())
874+
.with_stdout_unordered(expected)
878875
.with_stderr_data(str![[r#"
879876
[SUMMARY] [FILE_NUM] files, [FILE_SIZE]B total
880877
[WARNING] no files deleted due to --dry-run

0 commit comments

Comments
 (0)