From cedefc789695ac990bf1e001d7eadcd8e5fc6918 Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Thu, 29 Oct 2026 21:30:39 +0100 Subject: [PATCH] tests: readlink: ensure the last of readlink's -e, -f and -m wins Reported at https://github.com/uutils/coreutils/issues/15995 * tests/readlink/can-e.sh: Add test cases. Link: https://github.com/coreutils/coreutils/pull/431 --- tests/readlink/can-e.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tests/readlink/can-e.sh b/tests/readlink/can-e.sh index a9e74d569..e9b99b909 100755 --- a/tests/readlink/can-e.sh +++ b/tests/readlink/can-e.sh @@ -101,4 +101,14 @@ for p in "" "$pwd/$tmp/"; do test -z "$v" || fail=1 done +# The last of -e, -f and -m wins. +readlink -e -f missing > out || fail=1 +echo "$my_pwd/$tmp/missing" > exp || framework_failure_ +compare exp out || fail=1 +returns_ 1 readlink -f -e missing > out || fail=1 +compare /dev/null out || fail=1 +readlink -e -m missing/sub > out || fail=1 +echo "$my_pwd/$tmp/missing/sub" > exp || framework_failure_ +compare exp out || fail=1 + Exit $fail