Merge pull request #5625 from cakebaker/du_fix_test_du_no_dereference

du: fix issue with dereference in test
This commit is contained in:
Sylvestre Ledru 2023-12-08 19:19:33 +01:00 committed by GitHub
commit 355b4872b1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -365,12 +365,19 @@ fn test_du_no_dereference() {
.stdout_does_not_contain(symlink);
// ensure dereference "wins"
ts.ucmd()
.arg(arg)
.arg("--dereference")
.succeeds()
.stdout_contains(symlink)
.stdout_does_not_contain(dir);
let result = ts.ucmd().arg(arg).arg("--dereference").succeeds();
#[cfg(target_os = "linux")]
{
let result_reference = unwrap_or_return!(expected_result(&ts, &[arg, "--dereference"]));
if result_reference.succeeded() {
assert_eq!(result.stdout_str(), result_reference.stdout_str());
}
}
#[cfg(not(target_os = "linux"))]
result.stdout_contains(symlink).stdout_does_not_contain(dir);
}
}