diff options
Diffstat (limited to 'tests/cp/backup-1')
-rwxr-xr-x | tests/cp/backup-1 | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/tests/cp/backup-1 b/tests/cp/backup-1 index df696af38..c6c48e133 100755 --- a/tests/cp/backup-1 +++ b/tests/cp/backup-1 @@ -5,18 +5,19 @@ suffix=.b tmp=b1.$$ tmp_backup="$tmp$suffix" -rm -f $tmp +temp_files="$tmp $tmp_backup" +rm -f $temp_files -set -e -echo test > $tmp || exit 1 +fail=0 +echo test > $tmp || fail=1 $CP --force --backup --version-control=simple --suffix=$suffix $tmp $tmp \ - || exit 1 + || fail=1 -test $? = 0 || exit 1 - -test -f $tmp || exit 1 -test -f $tmp_backup || exit 1 +test -f $tmp || fail=1 +test -f $tmp_backup || fail=1 cmp $tmp $tmp_backup > /dev/null -exit 0 +rm -f $temp_files + +exit $fail |