From d6985039c93296fc76d5134ff0482bbeee0b8aa3 Mon Sep 17 00:00:00 2001 From: Alexander Bakanovskii Date: Sun, 28 Sep 2025 23:05:35 +0300 Subject: [PATCH] tests/df: test follow symlinks Signed-off-by: Alexander Bakanovskii --- tests/by-util/test_df.rs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/tests/by-util/test_df.rs b/tests/by-util/test_df.rs index ecb60bc5f..ec37f78b4 100644 --- a/tests/by-util/test_df.rs +++ b/tests/by-util/test_df.rs @@ -123,6 +123,22 @@ fn test_df_output() { assert_eq!(actual, expected); } +#[test] +fn test_df_follows_symlinks() { + let output = new_ucmd!() + .arg("-h") + .arg("--output=source") + .succeeds() + .stdout_str_lossy(); + + let filesystems = output.lines().skip(1).collect::>(); + assert!( + filesystems + .iter() + .all(|&x| !std::path::Path::new(x).is_symlink()) + ); +} + #[test] fn test_df_output_overridden() { let expected = if cfg!(target_os = "macos") {