summaryrefslogtreecommitdiff
path: root/tests/rm
diff options
context:
space:
mode:
Diffstat (limited to 'tests/rm')
-rwxr-xr-xtests/rm/interactive-once.sh25
1 files changed, 15 insertions, 10 deletions
diff --git a/tests/rm/interactive-once.sh b/tests/rm/interactive-once.sh
index 4ad76c01a..8fe7d81d2 100755
--- a/tests/rm/interactive-once.sh
+++ b/tests/rm/interactive-once.sh
@@ -30,13 +30,13 @@ rm -f out err || framework_failure_
# The prompt has a trailing space, and no newline, so an extra
# 'echo .' is inserted after each rm to make it obvious what was asked.
-echo 'one file, no recursion' > err || fail=1
+echo 'one file, no recursion' > err || framework_failure_
rm -I file1-* < in-n >> out 2>> err || fail=1
echo . >> err || fail=1
test -f file1-1 && fail=1
+echo 'one file, read only, answer no' >> err || framework_failure_
if ls /dev/stdin >/dev/null 2>&1; then
- echo 'one file, read only, answer no' >> err || fail=1
touch file1-1 || framework_failure_
chmod a-w file1-1 || framework_failure_
if ! test -w file1-1; then
@@ -48,16 +48,18 @@ if ls /dev/stdin >/dev/null 2>&1; then
if test "$write_prot_msg1"; then
test -f file1-1 || fail=1
fi
+else
+ echo '.' >> err || framework_failure_
fi
-echo 'three files, no recursion' >> err || fail=1
+echo 'three files, no recursion' >> err || framework_failure_
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
+echo 'four files, no recursion, answer no' >> err || framework_failure_
rm -I file3-* < in-n >> out 2>> err || fail=1
echo . >> err || fail=1
test -f file3-1 || fail=1
@@ -65,7 +67,7 @@ test -f file3-2 || fail=1
test -f file3-3 || fail=1
test -f file3-4 || fail=1
-echo 'four files, no recursion, answer yes' >> err || fail=1
+echo 'four files, no recursion, answer yes' >> err || framework_failure_
rm -I file3-* < in-y >> out 2>> err || fail=1
echo . >> err || fail=1
test -f file3-1 && fail=1
@@ -73,8 +75,9 @@ test -f file3-2 && fail=1
test -f file3-3 && fail=1
test -f file3-4 && fail=1
+echo 'four files, no recursion, 1 read only, answer yes no' >> err \
+ || framework_failure_
if ls /dev/stdin >/dev/null 2>&1; then
- echo 'four files, no recursion, 1 read only, answer yes no' >> err || fail=1
touch file3-1 file3-2 file3-3 file3-4 || framework_failure_
echo non_empty > file3-4 || framework_failure_ # to shorten diagnostic
chmod a-w file3-4 || framework_failure_
@@ -90,25 +93,27 @@ if ls /dev/stdin >/dev/null 2>&1; then
if test "$write_prot_msg2"; then
test -f file3-4 || fail=1
fi
+else
+ echo 'rm: remove 4 arguments? .' >> err || framework_failure_
fi
-echo 'one file, recursion, answer no' >> err || fail=1
+echo 'one file, recursion, answer no' >> err || framework_failure_
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
+echo 'one file, recursion, answer yes' >> err || framework_failure_
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
+echo 'multiple files, recursion, answer no' >> err || framework_failure_
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
+echo 'multiple files, recursion, answer yes' >> err || framework_failure_
rm -I -R dir2-* < in-y >> out 2>> err || fail=1
echo . >> err || fail=1
test -d dir2-1 && fail=1