summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>2000-07-23 09:00:22 +0000
committerJim Meyering <jim@meyering.net>2000-07-23 09:00:22 +0000
commit6d26d7c90878d013708748f62a60c2ad1b979db1 (patch)
treeb1408dd8591ba9411b5989f749ca711d42f971f0
parent8038df09a50878982679d161dca17fdec9715c5f (diff)
downloadcoreutils-6d26d7c90878d013708748f62a60c2ad1b979db1.tar.xz
*** empty log message ***
-rw-r--r--old/fileutils/ChangeLog5
-rwxr-xr-xtests/cp/dir-slash33
2 files changed, 38 insertions, 0 deletions
diff --git a/old/fileutils/ChangeLog b/old/fileutils/ChangeLog
index 1b457cb21..2fa96419d 100644
--- a/old/fileutils/ChangeLog
+++ b/old/fileutils/ChangeLog
@@ -1,3 +1,8 @@
+2000-07-23 Jim Meyering <meyering@lucent.com>
+
+ * tests/cp/Makefile.am (TESTS): Add dir-slash.
+ * tests/cp/dir-slash: New file.
+
2000-07-17 Jim Meyering <meyering@lucent.com>
* Makefile.maint (WGET): Define.
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