summaryrefslogtreecommitdiff
path: root/tests/cp/backup-1
diff options
context:
space:
mode:
Diffstat (limited to 'tests/cp/backup-1')
-rwxr-xr-xtests/cp/backup-122
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/cp/backup-1 b/tests/cp/backup-1
new file mode 100755
index 000000000..df696af38
--- /dev/null
+++ b/tests/cp/backup-1
@@ -0,0 +1,22 @@
+#!/bin/sh
+
+: ${CP=cp}
+
+suffix=.b
+tmp=b1.$$
+tmp_backup="$tmp$suffix"
+rm -f $tmp
+
+set -e
+echo test > $tmp || exit 1
+
+$CP --force --backup --version-control=simple --suffix=$suffix $tmp $tmp \
+ || exit 1
+
+test $? = 0 || exit 1
+
+test -f $tmp || exit 1
+test -f $tmp_backup || exit 1
+cmp $tmp $tmp_backup > /dev/null
+
+exit 0