summaryrefslogtreecommitdiff
path: root/tests/cp
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>1997-07-08 23:00:29 +0000
committerJim Meyering <jim@meyering.net>1997-07-08 23:00:29 +0000
commit0c073269a5180a1e5a9c48551b832fc743c416cb (patch)
tree8134bd772be93c667a34f352dbc23764a1a1e1ea /tests/cp
parent4e9441a1e7debf07e79ad68676ed884b99a21a76 (diff)
downloadcoreutils-0c073269a5180a1e5a9c48551b832fc743c416cb.tar.xz
.
Diffstat (limited to 'tests/cp')
-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