summaryrefslogtreecommitdiff
path: root/tests/rm/i-1
diff options
context:
space:
mode:
Diffstat (limited to 'tests/rm/i-1')
-rwxr-xr-xtests/rm/i-134
1 files changed, 13 insertions, 21 deletions
diff --git a/tests/rm/i-1 b/tests/rm/i-1
index 14ba0dc38..b0d939c2a 100755
--- a/tests/rm/i-1
+++ b/tests/rm/i-1
@@ -1,7 +1,7 @@
#!/bin/sh
# Test "rm -i".
-# Copyright (C) 1997, 1998, 2002, 2004, 2006 Free Software Foundation, Inc.
+# Copyright (C) 1997-1998, 2002, 2004, 2006-2007 Free Software Foundation, Inc.
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -23,33 +23,25 @@ if test "$VERBOSE" = yes; then
rm --version
fi
-pwd=`pwd`
-t0=`echo "$0"|sed 's,.*/,,'`.tmp;tmp=$t0/$$
-trap 'status=$?; cd "$pwd" && rm -rf $t0 && exit $status' 0
-trap '(exit $?); exit' 1 2 13 15
+. $srcdir/../test-lib.sh
-test_failure=0
-mkdir -p $tmp || test_failure=1
-echo > $tmp/a || test_failure=1
-test -f $tmp/a || test_failure=1
+t=t
+mkdir -p $t || framework_failure
+echo > $t/a || framework_failure
+test -f $t/a || framework_failure
-if test $test_failure = 1; then
- echo 'failure in testing framework'
- exit 1
-fi
-
-echo y > $tmp/$test.Iy
-echo n > $tmp/$test.In
+echo y > $t/$test.Iy
+echo n > $t/$test.In
fail=0
-rm -i $tmp/a < $tmp/$test.In > /dev/null 2>&1 || fail=1
+rm -i $t/a < $t/$test.In > /dev/null 2>&1 || fail=1
# The file should not have been removed.
-test -f $tmp/a || fail=1
+test -f $t/a || fail=1
-rm -i $tmp/a < $tmp/$test.Iy > /dev/null 2>&1 || fail=1
+rm -i $t/a < $t/$test.Iy > /dev/null 2>&1 || fail=1
# The file should have been removed this time.
-test -f $tmp/a && fail=1
+test -f $t/a && fail=1
-rm -rf $tmp
+rm -rf $t
(exit $fail); exit $fail