From: Sylvestre Ledru Date: Tue, 30 Dec 2025 23:14:59 +0000 (+0100) Subject: tests: du: check -l (--count-links) without -a flag X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=75e314a11a3ccfecadddf0270dc4619e3486ea66;p=thirdparty%2Fcoreutils.git tests: du: check -l (--count-links) without -a flag Identified here: * tests/du/hard-link.sh: Add the check. --- diff --git a/tests/du/hard-link.sh b/tests/du/hard-link.sh index 2debaa36ff..8fb79e6d42 100755 --- a/tests/du/hard-link.sh +++ b/tests/du/hard-link.sh @@ -61,4 +61,16 @@ EOF compare exp out || fail=1 +# Test du -l (--count-links) without -a flag +# This should count hard-linked files separately +mkdir test-dir && +echo 'content' > test-dir/file1 && +ln test-dir/file1 test-dir/file2 || framework_failure_ +du_normal=$(du test-dir | cut -f1) || fail=1 +du_count_links=$(du -l test-dir | cut -f1) || fail=1 +# The count-links version should be larger +if test "$du_normal" -gt 0; then + test "$du_count_links" -gt "$du_normal" || fail=1 +fi + Exit $fail