# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-test=f-1
-
. "${srcdir=.}/init.sh"; path_prepend_ ../src
print_ver_ rm
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-test=i-1
-
. "${srcdir=.}/init.sh"; path_prepend_ ../src
print_ver_ rm
echo > $t/a || framework_failure_
test -f $t/a || framework_failure_
-echo y > $t/$test.Iy
-echo n > $t/$test.In
+echo y > $t/in-y
+echo n > $t/in-n
-rm -i $t/a < $t/$test.In > /dev/null 2>&1 || fail=1
+rm -i $t/a < $t/in-n > /dev/null 2>&1 || fail=1
# The file should not have been removed.
test -f $t/a || fail=1
-rm -i $t/a < $t/$test.Iy > /dev/null 2>&1 || fail=1
+rm -i $t/a < $t/in-y > /dev/null 2>&1 || fail=1
# The file should have been removed this time.
test -f $t/a && fail=1
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-test=interactive-always
-
. "${srcdir=.}/init.sh"; path_prepend_ ../src
print_ver_ rm
|| framework_failure_
# If asked, answer no to first question, then yes to second.
echo 'n
-y' > $test.I || framework_failure_
+y' > in || framework_failure_
rm -f out err || framework_failure_
# 'echo .' is inserted after each rm to make it obvious what was asked.
echo 'no WHEN' > err || fail=1
-rm -R --interactive file1-* < $test.I >> out 2>> err || fail=1
+rm -R --interactive file1-* < in >> out 2>> err || fail=1
echo . >> err || fail=1
test -f file1-1 || fail=1
test -f file1-2 && fail=1
echo 'WHEN=never' >> err || fail=1
-rm -R --interactive=never file2-* < $test.I >> out 2>> err || fail=1
+rm -R --interactive=never file2-* < in >> out 2>> err || fail=1
echo . >> err || fail=1
test -f file2-1 && fail=1
test -f file2-2 && fail=1
echo 'WHEN=once' >> err || fail=1
-rm -R --interactive=once file3-* < $test.I >> out 2>> err || fail=1
+rm -R --interactive=once file3-* < in >> out 2>> err || fail=1
echo . >> err || fail=1
test -f file3-1 || fail=1
test -f file3-2 || fail=1
echo 'WHEN=always' >> err || fail=1
-rm -R --interactive=always file4-* < $test.I >> out 2>> err || fail=1
+rm -R --interactive=always file4-* < in >> out 2>> err || fail=1
echo . >> err || fail=1
test -f file4-1 || fail=1
test -f file4-2 && fail=1
echo '-f overrides --interactive' >> err || fail=1
-rm -R --interactive=once -f file1-* < $test.I >> out 2>> err || fail=1
+rm -R --interactive=once -f file1-* < in >> out 2>> err || fail=1
echo . >> err || fail=1
test -f file1-1 && fail=1
echo '--interactive overrides -f' >> err || fail=1
-rm -R -f --interactive=once file4-* < $test.I >> out 2>> err || fail=1
+rm -R -f --interactive=once file4-* < in >> out 2>> err || fail=1
echo . >> err || fail=1
test -f file4-1 || fail=1
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-test=interactive-once
-
. "${srcdir=.}/init.sh"; path_prepend_ ../src
print_ver_ rm
mkdir -p dir1-1 dir2-1 dir2-2 || framework_failure_
touch file1-1 file2-1 file2-2 file2-3 file3-1 file3-2 file3-3 file3-4 \
|| framework_failure_
-echo y > $test.Iy || framework_failure_
-echo n > $test.In || framework_failure_
+echo y > in-y || framework_failure_
+echo n > in-n || framework_failure_
rm -f out err || framework_failure_
# 'echo .' is inserted after each rm to make it obvious what was asked.
echo 'one file, no recursion' > err || fail=1
-rm -I file1-* < $test.In >> out 2>> err || fail=1
+rm -I file1-* < in-n >> out 2>> err || fail=1
echo . >> err || fail=1
test -f file1-1 && fail=1
echo 'three files, no recursion' >> err || fail=1
-rm -I file2-* < $test.In >> out 2>> err || fail=1
+rm -I file2-* < in-n >> out 2>> err || fail=1
echo . >> err || fail=1
test -f file2-1 && fail=1
test -f file2-2 && fail=1
test -f file2-3 && fail=1
echo 'four files, no recursion, answer no' >> err || fail=1
-rm -I file3-* < $test.In >> out 2>> err || fail=1
+rm -I file3-* < in-n >> out 2>> err || fail=1
echo . >> err || fail=1
test -f file3-1 || fail=1
test -f file3-2 || fail=1
test -f file3-4 || fail=1
echo 'four files, no recursion, answer yes' >> err || fail=1
-rm -I file3-* < $test.Iy >> out 2>> err || fail=1
+rm -I file3-* < in-y >> out 2>> err || fail=1
echo . >> err || fail=1
test -f file3-1 && fail=1
test -f file3-2 && fail=1
test -f file3-4 && fail=1
echo 'one file, recursion, answer no' >> err || fail=1
-rm -I -R dir1-* < $test.In >> out 2>> err || fail=1
+rm -I -R dir1-* < in-n >> out 2>> err || fail=1
echo . >> err || fail=1
test -d dir1-1 || fail=1
echo 'one file, recursion, answer yes' >> err || fail=1
-rm -I -R dir1-* < $test.Iy >> out 2>> err || fail=1
+rm -I -R dir1-* < in-y >> out 2>> err || fail=1
echo . >> err || fail=1
test -d dir1-1 && fail=1
echo 'multiple files, recursion, answer no' >> err || fail=1
-rm -I -R dir2-* < $test.In >> out 2>> err || fail=1
+rm -I -R dir2-* < in-n >> out 2>> err || fail=1
echo . >> err || fail=1
test -d dir2-1 || fail=1
test -d dir2-2 || fail=1
echo 'multiple files, recursion, answer yes' >> err || fail=1
-rm -I -R dir2-* < $test.Iy >> out 2>> err || fail=1
+rm -I -R dir2-* < in-y >> out 2>> err || fail=1
echo . >> err || fail=1
test -d dir2-1 && fail=1
test -d dir2-2 && fail=1
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-test=ir-1
-
. "${srcdir=.}/init.sh"; path_prepend_ ../src
print_ver_ rm
> $t/b/bb || framework_failure_
> $t/c/cc || framework_failure_
-cat <<EOF > $test.I
+cat <<EOF > in
y
y
y
# Remove all but one of a, b, c -- I doubt that this test can portably
# determine which one was removed based on order of dir entries.
# This is a good argument for switching to a dejagnu-style test suite.
-rm --verbose -i -r $t < $test.I > /dev/null 2>&1 || fail=1
+rm --verbose -i -r $t < in > /dev/null 2>&1 || fail=1
# $t should not have been removed.
test -d $t || fail=1
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-test=r-1
-
. "${srcdir=.}/init.sh"; path_prepend_ ../src
print_ver_ rm
mkdir a a/a || framework_failure_
> b || framework_failure_
-cat <<\EOF > $test.E || framework_failure_
+cat <<\EOF > exp || framework_failure_
removed directory: 'a/a'
removed directory: 'a'
removed 'b'
EOF
-rm --verbose -r a b > $test.O || fail=1
+rm --verbose -r a b > out || fail=1
for d in $dirs; do
- if test -d $d; then
- fail=1
- fi
+ test -d $d && fail=1
done
# Compare expected and actual output.
-compare $test.E $test.O || fail=1
+compare exp out || fail=1
Exit $fail