mirror of
https://github.com/coreutils/coreutils.git
synced 2025-01-07 00:23:23 +08:00
.
This commit is contained in:
parent
4e1e8c600d
commit
20f1f8b063
42
tests/cp/backup-is-src
Executable file
42
tests/cp/backup-is-src
Executable file
@ -0,0 +1,42 @@
|
||||
#!/bin/sh
|
||||
|
||||
: ${CP=cp}
|
||||
: ${RM=rm}
|
||||
|
||||
if test "$VERBOSE" = yes; then
|
||||
set -x
|
||||
$CP --version
|
||||
fi
|
||||
|
||||
framework_failure=0
|
||||
$RM -f a a~ || framework_failure=1
|
||||
: > a || framework_failure=1
|
||||
echo a > a~ || framework_failure=1
|
||||
|
||||
if test $framework_failure = 1; then
|
||||
echo 'failure in testing framework'
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Make sure we get English translations.
|
||||
LANGUAGE=C
|
||||
export LANGUAGE
|
||||
LC_ALL=C
|
||||
export LC_ALL
|
||||
LANG=C
|
||||
export LANG
|
||||
|
||||
# This cp command should exit nonzero.
|
||||
$CP -b -V simple a~ a > out 2>&1 && fail=1
|
||||
|
||||
sed "s,$CP:,XXX:," out > out2
|
||||
|
||||
cat > exp <<\EOF
|
||||
XXX: backing up `a' would destroy source; `a~' not copied
|
||||
EOF
|
||||
|
||||
cmp out2 exp || fail=1
|
||||
|
||||
#$RM -f $temp_files out out2 exp
|
||||
|
||||
exit $fail
|
Loading…
Reference in New Issue
Block a user