1
0
mirror of git://git.sv.gnu.org/coreutils.git synced 2026-04-14 07:46:28 +02:00
Files
coreutils/tests/rm/r-2
2000-05-03 11:09:07 +00:00

48 lines
858 B
Bash
Executable File

#!/bin/sh
test=r-2
: ${TMPDIR=.}
if test "$VERBOSE" = yes; then
rm --version
set -x
fi
tmp=$TMPDIR/t-rm.$$
mkdir $tmp $tmp/a $tmp/a/b
> $tmp/a/f
> $tmp/a/b/g
LANGUAGE=C
export LANGUAGE
LC_ALL=C
export LC_ALL
# FIXME: if this fails, it's a framework failure
cat <<EOF | sort > $tmp/$test.E
removing all entries of directory $tmp/a
removing all entries of directory $tmp/a/b
removing $tmp/a/b/g
removing the directory itself: $tmp/a/b
removing $tmp/a/f
removing the directory itself: $tmp/a
EOF
# Note that both the expected output (above) and the actual output lines
# are sorted, because directory entries may be processed in arbitrary order.
fail=0
rm --verbose -r $tmp/a | sort > $tmp/$test.O || fail=1
if test -d $tmp/a; then
fail=1
fi
# Compare expected and actual output.
cmp $tmp/$test.E $tmp/$test.O || fail=1
rm -rf $tmp
exit $fail