summaryrefslogtreecommitdiff
path: root/tests/cp/same-file
diff options
context:
space:
mode:
Diffstat (limited to 'tests/cp/same-file')
-rwxr-xr-xtests/cp/same-file80
1 files changed, 40 insertions, 40 deletions
diff --git a/tests/cp/same-file b/tests/cp/same-file
index 1556011aa..6d57ebd6a 100755
--- a/tests/cp/same-file
+++ b/tests/cp/same-file
@@ -53,7 +53,7 @@ contents=XYZ
for args in 'foo symlink' 'symlink foo' 'foo foo' 'sl1 sl2' 'foo hardlink'; do
for options in '' -d -f -df --rem -b -bd -bf -bdf \
- -l -dl -fl -dfl -bl -bdl -bfl -bdfl; do
+ -l -dl -fl -dfl -bl -bdl -bfl -bdfl; do
case $args$options in
# These tests are not portable.
# They all involve making a hard link to a symbolic link.
@@ -61,28 +61,28 @@ for args in 'foo symlink' 'symlink foo' 'foo foo' 'sl1 sl2' 'foo hardlink'; do
# by doing "continue" here and eliminating the corresponding
# expected output lines below. Don't do that anymore.
'symlink foo'-dfl)
- continue;;
+ continue;;
'symlink foo'-bdl)
- continue;;
+ continue;;
'symlink foo'-bdfl)
- continue;;
+ continue;;
'sl1 sl2'-dfl)
- continue;;
+ continue;;
'sl1 sl2'-bd*l)
- continue;;
+ continue;;
'sl1 sl2'-dl)
- continue;;
+ continue;;
esac
# cont'd Instead, skip them only on systems for which link does
# dereference a symlink. Detect and skip such tests here.
case $hard_link_to_symlink_does_the_deref:$args:$options in
'yes:sl1 sl2:-fl')
- continue ;;
+ continue ;;
'yes:sl1 sl2:-bl')
- continue ;;
+ continue ;;
'yes:sl1 sl2:-bfl')
- continue ;;
+ continue ;;
esac
rm -rf dir
@@ -95,37 +95,37 @@ for args in 'foo symlink' 'symlink foo' 'foo foo' 'sl1 sl2' 'foo hardlink'; do
case "$args" in *sl2*) ln -s foo sl2;; esac
(
(
- # echo 1>&2 cp $options $args
- cp $options $args 2>_err
- echo $? $options
-
- # Normalize the program name and diagnostics in the error output,
- # and put brackets around the output.
- if test -s _err; then
- sed '
- s/^[^:]*:\([^:]*\).*/cp:\1/
- 1s/^/[/
- $s/$/]/
- ' _err
+ # echo 1>&2 cp $options $args
+ cp $options $args 2>_err
+ echo $? $options
+
+ # Normalize the program name and diagnostics in the error output,
+ # and put brackets around the output.
+ if test -s _err; then
+ sed '
+ s/^[^:]*:\([^:]*\).*/cp:\1/
+ 1s/^/[/
+ $s/$/]/
+ ' _err
fi
- # Strip off all but the file names.
- ls=`ls -gG --ignore=_err . \
- | sed \
- -e '/^total /d' \
- -e 's/^[^ ]* *[^ ]* *[^ ]* *[^ ]* *[^ ]* *[^ ]* *//'`
- echo "($ls)"
- # Make sure the original is unchanged and that
- # the destination is a copy.
- for f in $args; do
- if test -f $f; then
- case "`cat $f`" in
- "$contents") ;;
- *) echo cp FAILED;;
- esac
- else
- echo symlink-loop
- fi
- done
+ # Strip off all but the file names.
+ ls=`ls -gG --ignore=_err . \
+ | sed \
+ -e '/^total /d' \
+ -e 's/^[^ ]* *[^ ]* *[^ ]* *[^ ]* *[^ ]* *[^ ]* *//'`
+ echo "($ls)"
+ # Make sure the original is unchanged and that
+ # the destination is a copy.
+ for f in $args; do
+ if test -f $f; then
+ case "`cat $f`" in
+ "$contents") ;;
+ *) echo cp FAILED;;
+ esac
+ else
+ echo symlink-loop
+ fi
+ done
) | tr '\n' ' '
echo
) | sed 's/ *$//'