diff options
| author | Dag-Erling Smørgrav <des@FreeBSD.org> | 2026-04-08 11:26:23 +0000 |
|---|---|---|
| committer | Dag-Erling Smørgrav <des@FreeBSD.org> | 2026-04-08 11:26:23 +0000 |
| commit | 1c793e7cbe2ecded388fd51fb20274891620a6f4 (patch) | |
| tree | ba676463dc5cf82147fe040825efb84de45b201d | |
| parent | 095cbb1bb7f7b4f742b0a500aa2c61a8c97d4b41 (diff) | |
stat: Nits in readlink tests
* The f_flag test may fail if a component of the full path to the
temporary directory is a symbolic link.
* The n_flag test had an empty head; give it a description.
* Use consistent quoting.
MFC after: 1 week
Sponsored by: Klara, Inc.
Reviewed by: kevans
Differential Revision: https://reviews.freebsd.org/D56293
| -rwxr-xr-x | usr.bin/stat/tests/readlink_test.sh | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/usr.bin/stat/tests/readlink_test.sh b/usr.bin/stat/tests/readlink_test.sh index d0107e0d655e..8eff21fa7a16 100755 --- a/usr.bin/stat/tests/readlink_test.sh +++ b/usr.bin/stat/tests/readlink_test.sh @@ -33,7 +33,7 @@ basic_head() basic_body() { atf_check ln -s foo bar - atf_check -o inline:'foo\n' readlink bar + atf_check -o inline:"foo\n" readlink bar } atf_test_case f_flag @@ -44,6 +44,7 @@ f_flag_head() } f_flag_body() { + cd "$(realpath "$PWD")" atf_check touch A.file atf_check ln -s nonexistent A.link atf_check -o inline:"nonexistent\n" \ @@ -55,13 +56,15 @@ f_flag_body() atf_test_case n_flag n_flag_head() { + atf_set "descr" "Verify that calling readlink with -n will not emit " \ + "a newline character." } n_flag_body() { atf_check ln -s nonexistent.A A atf_check ln -s nonexistent.B B - atf_check -o 'inline:nonexistent.A\nnonexistent.B\n' readlink A B - atf_check -o 'inline:nonexistent.Anonexistent.B' readlink -n A B + atf_check -o inline:"nonexistent.A\nnonexistent.B\n" readlink A B + atf_check -o inline:"nonexistent.Anonexistent.B" readlink -n A B } atf_init_test_cases() |
