diff options
author | Jim Meyering <jim@meyering.net> | 2000-07-23 09:00:22 +0000 |
---|---|---|
committer | Jim Meyering <jim@meyering.net> | 2000-07-23 09:00:22 +0000 |
commit | 6d26d7c90878d013708748f62a60c2ad1b979db1 (patch) | |
tree | b1408dd8591ba9411b5989f749ca711d42f971f0 /tests | |
parent | 8038df09a50878982679d161dca17fdec9715c5f (diff) | |
download | coreutils-6d26d7c90878d013708748f62a60c2ad1b979db1.tar.xz |
*** empty log message ***
Diffstat (limited to 'tests')
-rwxr-xr-x | tests/cp/dir-slash | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/tests/cp/dir-slash b/tests/cp/dir-slash new file mode 100755 index 000000000..130024d58 --- /dev/null +++ b/tests/cp/dir-slash @@ -0,0 +1,33 @@ +#!/bin/sh +# Make sure that cp -R DIR1 DIR2 does the right thing +# when DIR1 is written with a trailing slash. + +if test "$VERBOSE" = yes; then + set -x + cp --version +fi + +pwd=`pwd` +tmp=t-cpdirsl.$$ +trap 'status=$?; cd $pwd; rm -rf $tmp || exit $?; exit $status' 0 +trap 'exit $?' 1 2 13 15 + +framework_failure=0 +mkdir $tmp || framework_failure=1 +cd $tmp || framework_failure=1 + +mkdir dir1 dir2 || framework_failure=1 +touch dir1/file || framework_failure=1 + +if test $framework_failure = 1; then + echo 'failure in testing framework' + exit 1 +fi + +fail=0 +cp -R dir1/ dir2 || fail=1 +test -d dir2/dir1/file || fail=1 +test -d dir1/file || fail=1 + +(exit $fail) +exit $fail |