git: 2ae8d34666a6 - main - ln: Add a test case for ln -sfF.
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Wed, 27 Mar 2024 11:26:23 UTC
The branch main has been updated by des:
URL: https://cgit.FreeBSD.org/src/commit/?id=2ae8d34666a6dea4c1c77a1905c7b8cebd6a21f9
commit 2ae8d34666a6dea4c1c77a1905c7b8cebd6a21f9
Author: Dag-Erling Smørgrav <des@FreeBSD.org>
AuthorDate: 2024-03-27 10:03:56 +0000
Commit: Dag-Erling Smørgrav <des@FreeBSD.org>
CommitDate: 2024-03-27 10:03:56 +0000
ln: Add a test case for ln -sfF.
MFC after: 1 week
Sponsored by: Klara, Inc.
Reviewed by: allanjude, asomers
Differential Revision: https://reviews.freebsd.org/D44513
---
bin/ln/tests/ln_test.sh | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
diff --git a/bin/ln/tests/ln_test.sh b/bin/ln/tests/ln_test.sh
index 7daf5c5cdec0..8e5dcf81e61f 100644
--- a/bin/ln/tests/ln_test.sh
+++ b/bin/ln/tests/ln_test.sh
@@ -161,6 +161,22 @@ sf_flag_body()
atf_check_symlink_to A B
}
+atf_test_case sfF_flag
+sfF_flag_head()
+{
+ atf_set "descr" "Verify that if the target file already exists " \
+ "and is a symlink, then '-sfF' option removes " \
+ "it so that the link may occur"
+}
+sfF_flag_body()
+{
+ atf_check mkdir A B C
+ atf_check ln -sF A C
+ atf_check_symlink_to A C
+ atf_check ln -sfF B C
+ atf_check_symlink_to B C
+}
+
atf_test_case s_flag
s_flag_head()
{
@@ -209,6 +225,7 @@ atf_init_test_cases()
atf_add_test_case snf_flag_dir
atf_add_test_case sF_flag
atf_add_test_case sf_flag
+ atf_add_test_case sfF_flag
atf_add_test_case s_flag
atf_add_test_case s_flag_broken
atf_add_test_case sw_flag