aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMartin Stjernholm <mast@google.com>2020-08-21 02:11:25 +0100
committerRob Landley <rob@landley.net>2020-08-21 17:01:05 -0500
commit050e36a10ebf91bfe8307eea7fc5156d5daf8fc9 (patch)
tree4e89a88338597235cfcbdf087036945d36e95431 /tests
parent1740f71a5b316cc6db827e7102aaa08d1e3ddeb8 (diff)
downloadtoybox-050e36a10ebf91bfe8307eea7fc5156d5daf8fc9.tar.gz
Fix cp -P to not follow symlinks.
Also fix help text to say that it is not the default.
Diffstat (limited to 'tests')
-rwxr-xr-xtests/cp.test7
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/cp.test b/tests/cp.test
index c095aad2..040b4f15 100755
--- a/tests/cp.test
+++ b/tests/cp.test
@@ -127,6 +127,13 @@ testing "--parents b/c/d/file a/" "cp --parents b/c/d/file a/ && cat a/b/c/d/fil
rm -rf a/
rm -rf b/
+echo a > file
+testing "-P file" "cp -P file fdst && stat -c %F fdst" "regular file\n" "" ""
+ln -s file lnk
+testing "-P symlink" "cp -P lnk ldst && stat -c %F ldst" "symbolic link\n" "" ""
+testing "follow symlink" "cp lnk ldst2 && stat -c %F ldst2" "regular file\n" "" ""
+rm file fdst lnk ldst ldst2
+
# cp -r ../source destdir
# cp -r one/two/three missing
# cp -r one/two/three two