mirror of
git://git.sv.gnu.org/coreutils.git
synced 2026-03-23 21:34:32 +02:00
47 lines
703 B
Bash
Executable File
47 lines
703 B
Bash
Executable File
#!/bin/sh
|
|
|
|
: ${RM=rm}
|
|
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
|
|
|
|
# FIXME: if this fails, it's a framework failure
|
|
cat <<EOF > $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
|
|
|
|
LANGUAGE=C
|
|
export LANGUAGE
|
|
LANG=C
|
|
export LANG
|
|
|
|
fail=0
|
|
$RM --verbose -r $tmp/a > $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
|