summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorSylvestre Ledru <sylvestre@debian.org>2023-12-08 19:19:33 +0100
committerGitHub <noreply@github.com>2023-12-08 19:19:33 +0100
commit355b4872b106aab9233b903f7885157466582597 (patch)
tree4a21b076475dbd2f930cac2558b7731af86cb6d5 /tests
parent7695fe3fb3eef6e6ad10a7c2d0d10565f6c01d8e (diff)
parentc111dc88ac914b0f542501e014f0aa82e3570709 (diff)
Merge pull request #5625 from cakebaker/du_fix_test_du_no_dereference
du: fix issue with dereference in test
Diffstat (limited to 'tests')
-rw-r--r--tests/by-util/test_du.rs19
1 files changed, 13 insertions, 6 deletions
diff --git a/tests/by-util/test_du.rs b/tests/by-util/test_du.rs
index 10f32caf5..cb1341432 100644
--- a/tests/by-util/test_du.rs
+++ b/tests/by-util/test_du.rs
@@ -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);
}
}