From 88eb1da1da15bb9f62fc0db6d8586fc51bb6ff6a Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Sun, 24 Aug 1997 20:30:06 +0000 Subject: . --- tests/rm/ir-1 | 49 +++++++++++++++++++++++++++++-------------------- 1 file changed, 29 insertions(+), 20 deletions(-) (limited to 'tests/rm/ir-1') diff --git a/tests/rm/ir-1 b/tests/rm/ir-1 index b14a6806b..b1cf9ce82 100755 --- a/tests/rm/ir-1 +++ b/tests/rm/ir-1 @@ -14,33 +14,42 @@ fi tmp=$RM_TMPDIR/t-rm.$$ test_failure=0 -mkdir $tmp || test_failure=1 -mkdir $tmp/a $tmp/a/a || test_failure=1 -mkdir $tmp/b $tmp/b/bb || test_failure=1 -mkdir $tmp/c $tmp/c/cc || test_failure=1 +mkdir $tmp $tmp/a $tmp/b $tmp/c || test_failure=1 +touch $tmp/a/a $tmp/b/bb $tmp/c/cc || test_failure=1 -if $test_failure = 1; then +if test $test_failure = 1; then echo 'failure in testing framework' exit 1 fi -fail=0 -$RM --verbose -r $tmp > $tmp/$test.O || fail=1 - -for d in $dirs; do - if test -d $d; then - fail=1 - fi -done - -cat < $tmp/$test.E -$tmp/a -$tmp/a/a -$tmp/b +cat < $test.I +y +y +y +y +y +y +y +y +n +n +n EOF -# Compare expected and actual output. -cmp $tmp/$test.E $tmp/$test.O || fail=1 +# Remove all but one of a, b, c -- I doubt that this test can portably +# determine which one was removed based on order or dir entries. +# This is a good argument for switching to a dejagnu-style test suite. +fail=0 +$RM --verbose -i -r $tmp < $test.I > /dev/null || fail=1 + +# $tmp should not have been removed. +test -d $tmp || fail=1 + +# There should be only one directory left. +case $tmp/* in + $tmp/[abc]) ;; + *) fail=1 ;; +esac rm -rf $tmp -- cgit v1.2.3-54-g00ecf